Exemplo n.º 1
0
 public TvShow(TvShow toCopy)
 {
     this.ID          = toCopy.ID;
     this.TmdbID      = toCopy.TmdbID;
     this.Title       = toCopy.Title;
     this.Poster      = toCopy.Poster;
     this.DateIns     = toCopy.DateIns;
     this.SeasonCount = toCopy.SeasonCount;
     this.SeasonSeen  = toCopy.SeasonSeen;
 }
Exemplo n.º 2
0
 public TvShow(TvShow toCopy)
 {
     this.ID       = toCopy.ID;
     this.TmdbID   = toCopy.TmdbID;
     this.Title    = toCopy.Title;
     this.Poster   = toCopy.Poster;
     this.DateIns  = toCopy.DateIns;
     this.DateView = toCopy.DateView;
     this.Rating   = toCopy.Rating;
 }
Exemplo n.º 3
0
        // import data from csv file
        public async Task ImportTvShowDataFromFile(Stream DataFile)
        {
            TvShow TvShowImport, TvShowTMDB;

            string[] values;
            int      Result;

            try
            {
                TvShowsFound = new List <TvShow>();
                using (var reader = new StreamReader(DataFile))
                {
                    while (!reader.EndOfStream)
                    {
                        var line = reader.ReadLine();

                        if (!line.Contains("ID,Title,"))
                        {
                            values = line.Split(',');

                            //cerco il poster aggiornato
                            TvShowTMDB = SearchTvShowInTMDBByID(int.Parse(values[2]));

                            TvShowImport = new TvShow(TvShowTMDB);

                            TvShowImport.ID = int.Parse(values[0]);
                            //TvShowImport.Title = values[1];
                            //TvShowImport.TmdbID = int.Parse(values[2]);
                            if (values[3] != "")
                            {
                                TvShowImport.DateIns = DateTime.Parse(values[3], CultureInfo.CreateSpecificCulture("it-ITA"));
                            }
                            else
                            {
                                TvShowImport.DateIns = DateTime.Now;
                            }

                            //TvShowImport.Poster = TvShowTMDB.Poster;
                            //TvShowImport.SeasonCount = TvShowTMDB.SeasonCount;

                            TvShowsFound.Add(TvShowImport);
                        }
                    }

                    Result = await DB.InsertTvShowsAsync(TvShowsFound);
                }
            }
#pragma warning disable CS0168 // La variabile 'ex' è dichiarata, ma non viene mai usata
            catch (Exception ex)
#pragma warning restore CS0168 // La variabile 'ex' è dichiarata, ma non viene mai usata
            { Crashes.TrackError(ex); }
        }
Exemplo n.º 4
0
        public async Task <int> UpdateTvShowAsync(TvShow item)
        {
            try
            {
                return(await cnnDBAsync.UpdateAsync(item));
            }
#pragma warning disable CS0168 // La variabile 'e' è dichiarata, ma non viene mai usata
            catch (Exception ex)
#pragma warning restore CS0168 // La variabile 'e' è dichiarata, ma non viene mai usata
            {
                Crashes.TrackError(ex);
                return(0);
            }
        }
Exemplo n.º 5
0
        public void SearchTvShowInTMDB(string SearchText)
        {
            TMDbClient client = new TMDbClient(ApiKey.tmdbkeyV3, true);
            SearchContainer <SearchTv> results = client.SearchTvShowAsync(SearchText).Result;

            TvShowsFound = new List <TvShow>();
            TvShow TvShowFound;

            foreach (SearchTv result in results.Results)
            {
                TvShowFound        = new TvShow();
                TvShowFound.TmdbID = result.Id;
                TvShowFound.Title  = result.Name;
                TvShowFound.Poster = (result.PosterPath ?? "").Replace("/", "");

                TvShowsFound.Add(TvShowFound);
            }
        }
Exemplo n.º 6
0
 public TvShowDetails(TvShow toCopy)
     : base(toCopy)
 {
 }
Exemplo n.º 7
0
 public TvShowCardModel(TvShow tvshow)
 {
     DE = new DataExchange();
     //Get movie base data from the class movie selected
     TvShowDet = new TvShowDetails(tvshow);
 }