70 |
|
return files; |
71 |
|
} |
72 |
|
|
73 |
+ |
unsigned MediaFolder::GetFilesPages() const |
74 |
+ |
{ |
75 |
+ |
_R<dbi::Connection> connection(connector->Connect()); |
76 |
+ |
_R<dbi::ResultSet> count(connection->Parse(_B("SELECT count(path) FROM files WHERE live = TRUE AND folder = ?"))->Execute(path.GetPath())); |
77 |
+ |
unsigned pages(0); |
78 |
+ |
|
79 |
+ |
if (count->MoveNext()) |
80 |
+ |
pages = (count->Get<unsigned>(_B("count")) + 49) / 50; |
81 |
+ |
|
82 |
+ |
connector->Release(connection); |
83 |
+ |
|
84 |
+ |
return pages; |
85 |
+ |
} |
86 |
+ |
|
87 |
|
_L<MediaFolder> MediaFolder::GetFolders(unsigned page) const |
88 |
|
{ |
89 |
|
_R<dbi::Connection> connection(connector->Connect()); |
94 |
|
folders.InsertLast(MediaFolder(connector, paths->GetString(_B("path")))); |
95 |
|
|
96 |
|
connector->Release(connection); |
97 |
< |
|
97 |
> |
|
98 |
|
return folders; |
99 |
|
} |
100 |
+ |
|
101 |
+ |
unsigned MediaFolder::GetFoldersPages() const |
102 |
+ |
{ |
103 |
+ |
_R<dbi::Connection> connection(connector->Connect()); |
104 |
+ |
_R<dbi::ResultSet> count(connection->Parse(_B("SELECT count(path) FROM folders WHERE folder = ?"))->Execute(path.GetPath())); |
105 |
+ |
unsigned pages(0); |
106 |
+ |
|
107 |
+ |
if (count->MoveNext()) |
108 |
+ |
pages = (count->Get<unsigned>(_B("count")) + 49) / 50; |
109 |
+ |
|
110 |
+ |
connector->Release(connection); |
111 |
+ |
|
112 |
+ |
return pages; |
113 |
+ |
} |