ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/DecentralizedMedia/DecentralizedMedia.cpp
(Generate patch)

Comparing DecentralizedMedia/DecentralizedMedia.cpp (file contents):
Revision 502 by douglas, 2005-06-17T23:23:46-07:00 vs.
Revision 503 by douglas, 2005-06-18T01:34:41-07:00

# Line 50 | Line 50 | int Main(const app::Options& options)
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  
# Line 68 | Line 70 | DecentralizedMedia::DecentralizedMedia(c
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          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines