Example #1
0
        public IMusicLibrary Create(LibraryInfo library)
        {
            switch (library.Type)
            {
                case LibraryType.SharedFolder:
                    return new MusicHub.Implementation.FileSystemMusicLibrary(
                        library.Location,
                        _metadataService);

                case LibraryType.GoogleMusic:
                    return new MusicHub.GooglePlay.GoogleMusicMusicLibrary(
                        library.Username,
                        library.Password);

                default:
                    throw new NotImplementedException();
            }
        }
Example #2
0
 public void QueueLibrary(LibraryInfo libraryInfo)
 {
     lock (_queue)
         _queue.Enqueue(libraryInfo);
 }
Example #3
0
 private object ConvertLibrary(LibraryInfo library)
 {
     return new
     {
         id = library.Id,
         name = library.Name,
         songCount = library.TotalSongs,
     };
 }
Example #4
0
 public void updateLibraries(LibraryInfo[] libraries)
 {
     this._clients.updateLibraries(libraries.Select(ConvertLibrary));
 }