예제 #1
0
        private static void ConvertSeriesTimeZones(TVDoc doc, TheTVDB tvdb)
        {
            //this is just to convert timezones in the TheTVDB into the TVDOC where they should be:
            //itshould only do anything the first time it is run and then be entirely begign
            //can be removed after 1/1/19

            foreach (ShowItem si in doc.Library.GetShowItems())
            {
                string newTimeZone = tvdb.GetSeries(si.TVDBCode)?.tempTimeZone;

                if (string.IsNullOrWhiteSpace(newTimeZone))
                {
                    continue;
                }
                if (newTimeZone == TimeZone.DefaultTimeZone())
                {
                    continue;
                }
                if (si.ShowTimeZone != TimeZone.DefaultTimeZone())
                {
                    continue;
                }

                si.ShowTimeZone = newTimeZone;
                doc.SetDirty();
                logger.Info("Copied timezone:{0} onto series {1}", newTimeZone, si.ShowName);
            }
        }