예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Person"/> class.
 /// </summary>
 /// <param name="configuration">current configuration for CollectorzToKodi programs and Kodi</param>
 public Person(Configuration configuration)
 {
     this.configuration = configuration;
     this.name = string.Empty;
     this.url = string.Empty;
     this.thumb = string.Empty;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="SrtSubTitleFile"/> class.
        /// </summary>
        /// <param name="configuration">current configuration for CollectorzToKodi programs and Kodi</param>
        public SrtSubTitleFile(Configuration configuration)
            : base(configuration)
        {
            this.subTitleEntries = new List<SrtSubTitleFileEntry>();

            TimeSpan offsetTime;
            TimeSpan.TryParse("00:00:00.000", out offsetTime);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="MediaCollection"/> class.
        /// </summary>
        /// <param name="configuration">current configuration for CollectorzToKodi programs and Kodi</param>
        public MediaCollection(Configuration configuration)
        {
            this.configuration = configuration;
            this.movieCollection = new List<Movie>();
            this.seriesCollection = new List<Series>();

            this.seriesCollectionGroupedByMediaGroup = new List<Series>();
            this.seriesCollectionWithoutMediaGroup = new List<Series>();
        }
예제 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CollectorzToKodi.Episode"/> class.
 /// </summary>
 /// <param name="configuration">current configuration for CollectorzToKodi programs and Kodi</param>
 public Episode(Configuration configuration)
     : base(configuration)
 {
     this.actualSeason = string.Empty;
     this.actualEpisode = string.Empty;
     this.displaySeason = string.Empty;
     this.displayEpisode = string.Empty;
     this.series = null;
     this.isSpecial = false;
 }
예제 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Series"/> class.
 /// </summary>
 /// <param name="configuration">current configuration for CollectorzToKodi programs and Kodi</param>
 public Series(Configuration configuration)
     : base(configuration)
 {
     this.episodes = new List<Episode>();
     this.numberOfTotalEpisodes = 0;
     this.numberOfEpisodes = 0;
     this.numberOfSpecials = 0;
     this.numberOfEpisodesPerSeason = new List<int>();
     this.numberOfEpisodesPerSeason.Add(0); // Specials
     this.numberOfEpisodesPerSeason.Add(0); // Season 1
 }
예제 #6
0
        /// <summary>
        /// Entry-point for command-line-tool<br/>
        /// </summary>
        /// <returns>Error Code 1, if no valid file was assigned</returns>
        public static int Main()
        {
            Configuration configuration = new Configuration();
            MediaCollection mediaCollection = new MediaCollection(configuration);
            mediaCollection.ReadXML(configuration.MovieCollectorLocalPathToXMLExport);

            for (int i = 0; i < configuration.ServerNumberOfServers; i++)
            {
                int server = (int)i;

                using (StreamWriter swrSH = new StreamWriter(configuration.MovieCollectorLocalPathToXMLExportPath + "NFO" + configuration.ServerListsOfServers[(int)Configuration.ListOfServerTypes.NumberToName][server.ToString()] + "Win.sh", false, Encoding.UTF8, 512))
                {
                    // SH file header
                    swrSH.WriteLine("#!/bin/bash");
                    swrSH.WriteLine(string.Empty);

                    // Movie
                    swrSH.WriteLine("cd /share/XBMC/Filme/");

                    foreach (Movie movie in mediaCollection.ListMovieCollectionPerServer(server))
                    {
                        movie.WriteNFO();
                        movie.WriteSH(swrSH, true);
                    }

                    // series
                    swrSH.WriteLine(string.Empty);
                    swrSH.WriteLine("cd /share/XBMC/Serien/");

                    // remove old Series without MediaGroups
                    foreach (Series series in mediaCollection.ListSeriesCollectionWithoutMediaGroupPerServer(server))
                    {
                        series.WriteSH(swrSH, false);
                    }

                    // generate new entries
                    foreach (Series series in mediaCollection.ListSeriesCollectionPerServer(server))
                    {
                        series.WriteNFO();
                        series.WriteSH(swrSH, true);
                    }
                }
            }

            return 0;
        }
예제 #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Writer"/> class.<br/>
 /// <br/>
 /// Initializes Writer with blank values.
 /// </summary>
 /// <param name="configuration">current configuration for CollectorzToKodi programs and Kodi</param>
 public Writer(Configuration configuration)
     : base(configuration)
 {
 }
예제 #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Actor"/> class.<br/>
 /// <br/>
 /// Initializes actor with blank values.
 /// </summary>
 /// <param name="configuration">current configuration for CollectorzToKodi programs and Kodi</param>
 public Actor(Configuration configuration)
     : base(configuration)
 {
     this.role = string.Empty;
 }
예제 #9
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Video"/> class.
        /// </summary>
        /// <param name="configuration">current configuration for CollectorzToKodi programs and Kodi</param>
        public Video(Configuration configuration)
            : base(configuration)
        {
            this.mPAA = string.Empty;
            this.playCount = "0";
            this.playDate = string.Empty;
            this.iMDbId = string.Empty;
            this.directors = new List<Director>();
            this.writers = new List<Writer>();
            this.actors = new List<Actor>();
            this.videoIndex = 1;

            // Parameter
            this.videoCodec = Configuration.VideoCodec.H265;
            this.videoDefinition = Configuration.VideoDefinition.SD;
            this.videoAspectRatio = Configuration.VideoAspectRatio.AspectRatio169;
            this.audioStreams = new List<AudioStream>();
            this.subTitles = new List<SubTitle>();
        }
예제 #10
0
 /// <summary>
 /// return new Actor or SeriesActor depending on referring class
 /// </summary>
 /// <param name="configuration">current configuration for CollectorzToKodi programs and Kodi</param>
 /// <returns>new Actor</returns>
 public virtual Actor ActorFactory(Configuration configuration)
 {
     return new Actor(configuration);
 }
예제 #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Media"/> class.
 /// </summary>
 /// <param name="configuration">current configuration for CollectorzToKodi programs and Kodi</param>
 public Media(Configuration configuration)
 {
     this.configuration = configuration;
     this.title = string.Empty;
     this.titleSort = string.Empty;
     this.titleOriginal = string.Empty;
     this.mediaGroup = string.Empty;
     this.rating = string.Empty;
     this.publishingYear = string.Empty;
     this.publishingDate = string.Empty;
     this.content = string.Empty;
     this.runTime = string.Empty;
     this.images = new List<ImageFile>();
     this.country = string.Empty;
     this.genres = new List<string>();
     this.studios = new List<string>();
     this.mediaFiles = new List<MediaFile>();
     this.filename = string.Empty;
     this.mediaLanguages = new List<string>();
 }
예제 #12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SubTitleFile"/> class.
 /// </summary>
 /// <param name="configuration">current configuration for CollectorzToKodi programs and Kodi</param>
 public SubTitleFile(Configuration configuration)
     : base(configuration)
 {
     this.subTitle = null;
 }
예제 #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VideoFile"/> class.
 /// </summary>
 /// <param name="configuration">current configuration for CollectorzToKodi programs and Kodi</param>
 public VideoFile(Configuration configuration)
     : base(configuration)
 {
     this.isSpecial = false;
 }
예제 #14
0
 /// <inheritdoc/>
 public override Actor ActorFactory(Configuration configuration)
 {
     return new SeriesActor(configuration);
 }
예제 #15
0
        /// <summary>
        ///  Writes images to provided NFO file, when they meet to specified image type
        /// </summary>
        /// <param name="swrNFO">NFO file that the image information should be added to</param>
        /// <param name="imageType">Image type, that should be added</param>
        private void WriteImagesToNFO(StreamWriter swrNFO, Configuration.ImageType imageType)
        {
            for (int i = 0; i < this.Images.Count; i++)
            {
                ImageFile imageFile = this.Images.ElementAt(i);

                if (imageFile.Filename != string.Empty && imageFile.ImageType == imageType)
                {
                    if (/* Fanart */ imageFile.ImageType == Configuration.ImageType.CoverFront || imageFile.ImageType == Configuration.ImageType.Backdrop ||
                        /* Poster */ imageFile.ImageType == Configuration.ImageType.Poster)
                    {
                        if (/* Fanart */ imageFile.ImageType == Configuration.ImageType.Backdrop ||
                            /* Poster */ imageFile.ImageType == Configuration.ImageType.Poster)
                        {
                            swrNFO.Write("    ");
                        }

                        swrNFO.WriteLine("    <thumb>smb://" + this.Configuration.ServerListsOfServers[(int)Configuration.ListOfServerTypes.NumberToName][imageFile.Media.Server.ElementAt(0).ToString()] + "/XBMC/" + (imageFile.Media.GetType().ToString().Contains("Movie") ? "Filme" : "Serien") + "/" + imageFile.Media.Filename + "/" + imageFile.Filename + "</thumb>");
                    }

                    if (/* Fanart */ imageFile.ImageType == Configuration.ImageType.SeasonCover || imageFile.ImageType == Configuration.ImageType.SeasonBackdrop ||
                        /* Poster */ imageFile.ImageType == Configuration.ImageType.SeasonPoster)
                    {
                        if (/* Fanart */ imageFile.ImageType == Configuration.ImageType.SeasonBackdrop ||
                            /* Poster*/ imageFile.ImageType == Configuration.ImageType.SeasonPoster)
                        {
                            swrNFO.Write("    ");
                        }

                        swrNFO.WriteLine("    <thumb type=\"season\" season=\"" + imageFile.Season + "\">smb://" + this.Configuration.ServerListsOfServers[(int)Configuration.ListOfServerTypes.NumberToName][imageFile.Media.Server.ElementAt(0).ToString()] + "/XBMC/" + (imageFile.Media.GetType().ToString().Contains("Movie") ? "Filme" : "Serien") + "/" + imageFile.Media.Filename + "/" + (imageFile.Season != "-1" ? "Season " + this.ConvertSeason(imageFile.Season) + "/" : string.Empty) + imageFile.Filename + "</thumb>");
                    }
                }
            }
        }
예제 #16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SubTitle"/> class.
 /// </summary>
 /// <param name="configuration">current configuration for CollectorzToKodi programs and Kodi</param>
 public SubTitle(Configuration configuration)
 {
     this.language = "Deutsch";
     this.video = null;
 }
예제 #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Movie"/> class.
 /// </summary>
 /// <param name="configuration">current configuration for CollectorzToKodi programs and Kodi</param>
 public Movie(Configuration configuration)
     : base(configuration)
 {
 }
예제 #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Director"/> class.<br/>
 /// <br/>
 /// Initializes Director with blank values.
 /// </summary>
 /// <param name="configuration">current configuration for CollectorzToKodi programs and Kodi</param>
 public Director(Configuration configuration)
     : base(configuration)
 {
 }
예제 #19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SeriesActor"/> class.<br/>
 /// <br/>
 /// Initializes SeriesActor with blank values.
 /// </summary>
 /// <param name="configuration">current configuration for CollectorzToKodi programs and Kodi</param>
 public SeriesActor(Configuration configuration)
     : base(configuration)
 {
     this.seasons = new List<string>();
 }