use of org.fourthline.cling.support.model.container.StorageFolder in project libresonic by Libresonic.
the class FolderBasedContentDirectory method browseRootMetadata.
private BrowseResult browseRootMetadata() throws Exception {
StorageFolder root = new StorageFolder();
root.setId(CONTAINER_ID_ROOT);
root.setParentID("-1");
MediaLibraryStatistics statistics = settingsService.getMediaLibraryStatistics();
root.setStorageUsed(statistics == null ? 0 : statistics.getTotalLengthInBytes());
root.setTitle("Libresonic Media");
root.setRestricted(true);
root.setSearchable(false);
root.setWriteStatus(WriteStatus.NOT_WRITABLE);
List<MusicFolder> musicFolders = settingsService.getAllMusicFolders();
// +1 for playlists
root.setChildCount(musicFolders.size() + 1);
DIDLContent didl = new DIDLContent();
didl.addContainer(root);
return createBrowseResult(didl, 1, 1);
}
use of org.fourthline.cling.support.model.container.StorageFolder in project libresonic by Libresonic.
the class FolderBasedContentDirectory method createPlaylistRootContainer.
private Container createPlaylistRootContainer() {
Container container = new StorageFolder();
container.setId(CONTAINER_ID_PLAYLIST_ROOT);
container.setTitle("Playlists");
List<Playlist> playlists = playlistService.getAllPlaylists();
container.setChildCount(playlists.size());
container.setParentID(CONTAINER_ID_ROOT);
return container;
}
Aggregations