Пример #1
0
        public string ReadSongSourcePath()
        {
            try
            {
                this.LoadToCache();

                return(LibraryDeserializer.DeserializeSongSourcePath(this.cache));
            }

            catch (Exception ex) if (ex is JsonException || ex is IOException)
                {
                    throw new LibraryReadException("Failed to read song source path.", ex);
                }
        }
Пример #2
0
        public IReadOnlyList <Playlist> ReadPlaylists()
        {
            try
            {
                this.LoadToCache();

                return(LibraryDeserializer.DeserializePlaylists(this.cache, this.songCache));
            }

            catch (Exception ex) if (ex is JsonException || ex is IOException)
                {
                    throw new LibraryReadException("Failed to read playlists.", ex);
                }
        }
Пример #3
0
        public IReadOnlyList <LocalSong> ReadSongs()
        {
            IReadOnlyList <LocalSong> songs;

            try
            {
                this.LoadToCache();

                songs = LibraryDeserializer.DeserializeSongs(this.cache);
            }

            catch (Exception ex) if (ex is JsonException || ex is IOException)
                {
                    throw new LibraryReadException("Failed to read songs.", ex);
                }

            this.songCache = songs;
            return(songs);
        }