50 |
|
|
51 |
|
DecentralizedMedia::DecentralizedMedia(const ext::RedBlackSet<ext::String>& extensions, const ext::RedBlackSet<ext::String>& locals) : waf::Server(_B("Web")), process(bmp.IsRunning() ? NULL : new api::Process(_B("/usr/X11R6/bin/beep-media-player"))), connection(dbi::GetDriver("pgsql")->Connect("", "douglas", "", "media")), extensions(extensions) |
52 |
|
{ |
53 |
+ |
connection->Execute(_B("UPDATE files SET live = FALSE")); |
54 |
+ |
|
55 |
|
_foreach (const ext::RedBlackSet<ext::String>, local, locals) |
56 |
|
MediaFolder(connection, *local, *local); |
57 |
|
|
70 |
|
|
71 |
|
_H<api::Process> find(new api::Process(_B("/usr/bin/find"), args)); |
72 |
|
ext::String file; |
73 |
+ |
api::Path root; |
74 |
|
|
75 |
< |
while (ios::ReadLine(*find->GetReader(), file)) if (!locals.Contains(file)) |
76 |
< |
{ |
77 |
< |
} |
75 |
> |
while (ios::ReadLine(*find->GetReader(), file)) |
76 |
> |
if (locals.Contains(file)) |
77 |
> |
root = file; |
78 |
> |
else |
79 |
> |
{ |
80 |
> |
api::Path path(file); |
81 |
> |
|
82 |
> |
if (path.IsDirectory()) |
83 |
> |
MediaFolder(connection, path, root); |
84 |
> |
else |
85 |
> |
MediaFile(connection, path, ext::EmptyString, ext::EmptyString, ext::EmptyString, ext::EmptyString, root); |
86 |
> |
} |
87 |
|
|
88 |
|
find->Join(); |
89 |
|
} |