Search in sources :

Example 1 with StorageFolder

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);
}
Also used : StorageFolder(org.fourthline.cling.support.model.container.StorageFolder)

Example 2 with StorageFolder

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;
}
Also used : Container(org.fourthline.cling.support.model.container.Container) PlaylistContainer(org.fourthline.cling.support.model.container.PlaylistContainer) StorageFolder(org.fourthline.cling.support.model.container.StorageFolder)

Aggregations

StorageFolder (org.fourthline.cling.support.model.container.StorageFolder)2 Container (org.fourthline.cling.support.model.container.Container)1 PlaylistContainer (org.fourthline.cling.support.model.container.PlaylistContainer)1