Ejemplo n.º 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();
            }
        }
Ejemplo n.º 2
0
 public void QueueLibrary(LibraryInfo libraryInfo)
 {
     lock (_queue)
         _queue.Enqueue(libraryInfo);
 }
Ejemplo n.º 3
0
 private object ConvertLibrary(LibraryInfo library)
 {
     return new
     {
         id = library.Id,
         name = library.Name,
         songCount = library.TotalSongs,
     };
 }
Ejemplo n.º 4
0
 public void updateLibraries(LibraryInfo[] libraries)
 {
     this._clients.updateLibraries(libraries.Select(ConvertLibrary));
 }