105 |
|
{ |
106 |
|
if (!process.IsEmpty()) |
107 |
|
{ |
108 |
< |
_P<api::Thread> thread(new _H<api::Thread>(hop::BindAll(&DecentralizedMedia::Destroy, this))); |
108 |
> |
_R<api::Thread> thread(new _H<api::Thread>(hop::BindAll(&DecentralizedMedia::Destroy, this))); |
109 |
|
|
110 |
|
bmp.Quit(); |
111 |
|
|
115 |
|
|
116 |
|
_L<cse::String> DecentralizedMedia::GetArtists() const |
117 |
|
{ |
118 |
< |
_P<dbi::ResultSet> artists_(connection->Execute(_B("SELECT DISTINCT artist FROM files WHERE live = TRUE"))); |
118 |
> |
_R<dbi::ResultSet> artists_(connection->Execute(_B("SELECT DISTINCT artist FROM files WHERE live = TRUE"))); |
119 |
|
_L<cse::String> artists; |
120 |
|
|
121 |
|
while (artists_->MoveNext()) |
126 |
|
|
127 |
|
_L<cse::String> DecentralizedMedia::GetTitles() const |
128 |
|
{ |
129 |
< |
_P<dbi::ResultSet> titles_(connection->Execute(_B("SELECT DISTINCT title FROM files WHERE live = TRUE"))); |
129 |
> |
_R<dbi::ResultSet> titles_(connection->Execute(_B("SELECT DISTINCT title FROM files WHERE live = TRUE"))); |
130 |
|
_L<cse::String> titles; |
131 |
|
|
132 |
|
while (titles_->MoveNext()) |
137 |
|
|
138 |
|
_L<cse::String> DecentralizedMedia::GetAlbums() const |
139 |
|
{ |
140 |
< |
_P<dbi::ResultSet> albums_(connection->Execute(_B("SELECT DISTINCT album FROM files WHERE live = TRUE"))); |
140 |
> |
_R<dbi::ResultSet> albums_(connection->Execute(_B("SELECT DISTINCT album FROM files WHERE live = TRUE"))); |
141 |
|
_L<cse::String> albums; |
142 |
|
|
143 |
|
while (albums_->MoveNext()) |
148 |
|
|
149 |
|
_L<cse::String> DecentralizedMedia::GetGenres() const |
150 |
|
{ |
151 |
< |
_P<dbi::ResultSet> genres_(connection->Execute(_B("SELECT DISTINCT album FROM files WHERE live = TRUE"))); |
151 |
> |
_R<dbi::ResultSet> genres_(connection->Execute(_B("SELECT DISTINCT album FROM files WHERE live = TRUE"))); |
152 |
|
_L<cse::String> genres; |
153 |
|
|
154 |
|
while (genres_->MoveNext()) |
159 |
|
|
160 |
|
_L<MediaFolder> DecentralizedMedia::GetFolders() const |
161 |
|
{ |
162 |
< |
_P<dbi::ResultSet> paths(connection->Execute(_B("SELECT DISTINCT root FROM files WHERE live = TRUE"))); |
162 |
> |
_R<dbi::ResultSet> paths(connection->Execute(_B("SELECT DISTINCT root FROM files WHERE live = TRUE"))); |
163 |
|
_L<MediaFolder> folders; |
164 |
|
|
165 |
|
while (paths->MoveNext()) |
198 |
|
|
199 |
|
void DecentralizedMedia::Media(ios::Reader& media, const api::Address& host) |
200 |
|
{ |
201 |
< |
_P<xml::Document> document(xml::Parse(media)); |
201 |
> |
_R<xml::Document> document(xml::Parse(media)); |
202 |
|
api::Pcre::RegEx share("^[0-9a-f]+$"); |
203 |
|
|
204 |
|
_foreach (const xml::NodeSet, folder, *document/"media"/"folder") |
207 |
|
|
208 |
|
if (api::Pcre::RegEx::Match match = share(path)) |
209 |
|
{ |
210 |
< |
_P<Share> share(new _H<Share>(connection, host, match[0])); |
210 |
> |
_R<Share> share(new _H<Share>(connection, host, match[0])); |
211 |
|
|
212 |
|
path = share->path.GetPath(); |
213 |
|
|
223 |
|
} |
224 |
|
} |
225 |
|
|
226 |
< |
void DecentralizedMedia::Media(const _P<xml::Node>& folder, const api::Path& path, const api::Path& root) |
226 |
> |
void DecentralizedMedia::Media(const _R<xml::Node>& folder, const api::Path& path, const api::Path& root) |
227 |
|
{ |
228 |
|
MediaFolder(connection, path, root); |
229 |
|
|