org.fourthline.cling.support.model.container.StorageFolder Java Examples

The following examples show how to use org.fourthline.cling.support.model.container.StorageFolder. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RootUpnpProcessor.java    From airsonic-advanced with GNU General Public License v3.0 6 votes vote down vote up
public Container createRootContainer() {
    StorageFolder root = new StorageFolder();
    root.setId(DispatchingContentDirectory.CONTAINER_ID_ROOT);
    root.setParentID("-1");

    MediaLibraryStatistics statistics = indexManager.getStatistics();
    // returning large storageUsed values doesn't play nicely with
    // some upnp clients
    //root.setStorageUsed(statistics == null ? 0 : statistics.getTotalLengthInBytes());
    root.setStorageUsed(-1L);
    root.setTitle("Airsonic Media");
    root.setRestricted(true);
    root.setSearchable(true);
    root.setWriteStatus(WriteStatus.NOT_WRITABLE);

    root.setChildCount(6);
    return root;
}
 
Example #2
Source File: FolderBasedContentDirectory.java    From airsonic-advanced with GNU General Public License v3.0 6 votes vote down vote up
private BrowseResult browseRootMetadata() throws Exception {
    StorageFolder root = new StorageFolder();
    root.setId(CONTAINER_ID_ROOT);
    root.setParentID("-1");

    MediaLibraryStatistics statistics = indexManager.getStatistics();
    root.setStorageUsed(statistics == null ? 0 : statistics.getTotalLengthInBytes());
    root.setTitle("Airsonic Media");
    root.setRestricted(true);
    root.setSearchable(false);
    root.setWriteStatus(WriteStatus.NOT_WRITABLE);

    List<MusicFolder> musicFolders = settingsService.getAllMusicFolders();
    root.setChildCount(musicFolders.size() + 1);  // +1 for playlists

    DIDLContent didl = new DIDLContent();
    didl.addContainer(root);
    return createBrowseResult(didl, 1, 1);
}
 
Example #3
Source File: RootUpnpProcessor.java    From airsonic with GNU General Public License v3.0 6 votes vote down vote up
public Container createRootContainer() {
    StorageFolder root = new StorageFolder();
    root.setId(DispatchingContentDirectory.CONTAINER_ID_ROOT);
    root.setParentID("-1");

    MediaLibraryStatistics statistics = indexManager.getStatistics();
    // returning large storageUsed values doesn't play nicely with
    // some upnp clients
    //root.setStorageUsed(statistics == null ? 0 : statistics.getTotalLengthInBytes());
    root.setStorageUsed(-1L);
    root.setTitle("Airsonic Media");
    root.setRestricted(true);
    root.setSearchable(true);
    root.setWriteStatus(WriteStatus.NOT_WRITABLE);

    root.setChildCount(6);
    return root;
}
 
Example #4
Source File: FolderBasedContentDirectory.java    From airsonic with GNU General Public License v3.0 6 votes vote down vote up
private BrowseResult browseRootMetadata() throws Exception {
    StorageFolder root = new StorageFolder();
    root.setId(CONTAINER_ID_ROOT);
    root.setParentID("-1");

    MediaLibraryStatistics statistics = indexManager.getStatistics();
    root.setStorageUsed(statistics == null ? 0 : statistics.getTotalLengthInBytes());
    root.setTitle("Airsonic Media");
    root.setRestricted(true);
    root.setSearchable(false);
    root.setWriteStatus(WriteStatus.NOT_WRITABLE);

    List<MusicFolder> musicFolders = settingsService.getAllMusicFolders();
    root.setChildCount(musicFolders.size() + 1);  // +1 for playlists

    DIDLContent didl = new DIDLContent();
    didl.addContainer(root);
    return createBrowseResult(didl, 1, 1);
}
 
Example #5
Source File: FolderBasedContentDirectory.java    From subsonic with GNU General Public License v3.0 6 votes vote down vote up
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("Subsonic Media");
    root.setRestricted(true);
    root.setSearchable(false);
    root.setWriteStatus(WriteStatus.NOT_WRITABLE);

    List<MusicFolder> musicFolders = settingsService.getAllMusicFolders();
    root.setChildCount(musicFolders.size() + 1);  // +1 for playlists

    DIDLContent didl = new DIDLContent();
    didl.addContainer(root);
    return createBrowseResult(didl, 1, 1);
}
 
Example #6
Source File: UpnpContentProcessor.java    From airsonic-advanced with GNU General Public License v3.0 5 votes vote down vote up
public Container createRootContainer() throws Exception {
    Container container = new StorageFolder();
    container.setId(getRootId());
    container.setTitle(getRootTitle());

    int childCount = getAllItemsSize();
    container.setChildCount(childCount);
    container.setParentID(DispatchingContentDirectory.CONTAINER_ID_ROOT);
    return container;
}
 
Example #7
Source File: FolderBasedContentDirectory.java    From airsonic-advanced with GNU General Public License v3.0 5 votes vote down vote up
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;
}
 
Example #8
Source File: UpnpContentProcessor.java    From airsonic with GNU General Public License v3.0 5 votes vote down vote up
public Container createRootContainer() throws Exception {
    Container container = new StorageFolder();
    container.setId(getRootId());
    container.setTitle(getRootTitle());

    int childCount = getAllItemsSize();
    container.setChildCount(childCount);
    container.setParentID(DispatchingContentDirectory.CONTAINER_ID_ROOT);
    return container;
}
 
Example #9
Source File: FolderBasedContentDirectory.java    From airsonic with GNU General Public License v3.0 5 votes vote down vote up
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;
}
 
Example #10
Source File: FolderBasedContentDirectory.java    From subsonic with GNU General Public License v3.0 5 votes vote down vote up
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;
}