Beispiel #1
0
        public bool ReadPlaylist()
        {
            string oldPlaylistPath = $"Playlists\\{this.fileName}.json";
            string newPlaylistPath = $"Playlists\\{this.fileName}.bplist";

            oldFormat = !File.Exists(newPlaylistPath);
            Plugin.Log($"Playlist \"{Title}\" found in {(oldFormat?"old":"new")} playlist format.");

            string playlistPath = oldFormat ? oldPlaylistPath : newPlaylistPath;

            if (File.Exists(playlistPath))
            {
                var playlist = PlaylistIO.ReadPlaylistSongs(this);
                if (playlist != null)
                {
                    this.Title   = playlist.Title;
                    this.Author  = playlist.Author;
                    this.Image   = playlist.Image;
                    this.Songs   = playlist.Songs;
                    this.fileLoc = playlist.fileLoc;
                    Plugin.Log("Success loading playlist!");
                    return(true);
                }
            }
            return(false);
        }
Beispiel #2
0
        public bool ReadPlaylist()
        {
            var oldPlaylistPath = $"Playlists\\{this.fileName}.json";
            var newPlaylistPath = $"Playlists\\{this.fileName}.bplist";

            this.oldFormat = File.Exists(oldPlaylistPath);
            Logger.Info($"Playlist \"{this.Title}\" found in {(this.oldFormat ? "old" : "new")} playlist format.");

            var playlistPath = this.oldFormat ? oldPlaylistPath : newPlaylistPath;

            if (File.Exists(playlistPath))
            {
                var playlist = PlaylistIO.ReadPlaylistSongs(this);
                if (playlist != null)
                {
                    this.Title   = playlist.Title;
                    this.Author  = playlist.Author;
                    this.Image   = playlist.Image;
                    this.Songs   = playlist.Songs;
                    this.fileLoc = playlist.fileLoc;
                    Logger.Info("Success loading playlist!");
                    return(true);
                }
            }
            return(false);
        }