/// <summary>
 /// Internal constructor for a <see cref="PlaylistManager"/> with a parent.
 /// </summary>
 /// <param name="playlistDirectory"></param>
 /// <param name="parent"></param>
 protected PlaylistManager(string playlistDirectory, PlaylistManager parent)
     : this(playlistDirectory)
 {
     Parent = parent;
 }
Exemplo n.º 2
0
        public static BeatSaberPlaylistsLib.Types.IPlaylist CreatePlaylist(string playlistName, string playlistAuthorName, BeatSaberPlaylistsLib.PlaylistManager playlistManager, bool defaultCover = true)
        {
            BeatSaberPlaylistsLib.Types.IPlaylist playlist = playlistManager.CreatePlaylist("", playlistName, playlistAuthorName, "");

            if (defaultCover)
            {
                using (Stream imageStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("PlaylistManager.Icons.Logo.png"))
                {
                    playlist.SetCover(imageStream);
                }
            }

            if (!PluginConfig.Instance.DefaultAllowDuplicates)
            {
                playlist.AllowDuplicates = false;
            }

            // Easter Egg
            if (PluginConfig.Instance.AuthorName.ToUpper().Contains("BINTER") && playlistName.ToUpper().Contains("TECH") && PluginConfig.Instance.EasterEggs)
            {
                playlist.SetCustomData("syncURL", EASTER_EGG_URL);
            }

            playlistManager.StorePlaylist(playlist);
            return(playlist);
        }