예제 #1
0
        public static MediaContainer NewMediaContainer(MediaContainerTypes type, HistoryInfo info = null, bool allowsync = true, bool nocache = true)
        {
            MediaContainer m = new MediaContainer();

            m.AllowSync           = allowsync ? "1" : "0";
            m.NoCache             = nocache ? "1" : "0";
            m.MediaTagVersion     = MediaTagVersion;
            m.Identifier          = "com.plexapp.plugins.myanime";
            m.MediaTagPrefix      = "/system/bundle/media/flags/";
            m.LibrarySectionTitle = "Anime";
            if (info != null)
            {
                m.FillInfo(info);
            }
            m.GrandparentTitle = m.ParentTitle ?? "";
            m.Title1           = m.Title2 = m.Title;
            m.ParentTitle      = "";
            m.Title            = null;
            switch (type)
            {
            case MediaContainerTypes.Show:
                m.ViewGroup = "show";
                m.ViewMode  = "65592";

                break;

            case MediaContainerTypes.Episode:
                m.ViewGroup = "episode";
                m.ViewMode  = "65592";
                break;

            case MediaContainerTypes.Video:
                m.ViewMode  = "65586";
                m.ViewGroup = "video";
                break;

            case MediaContainerTypes.Season:
                m.ViewMode  = "65593";
                m.ViewGroup = "season";
                break;

            case MediaContainerTypes.Movie:
            case MediaContainerTypes.File:
                break;
            }
            return(m);
        }