Example #1
0
        internal void Update(FileEntry entry)
        {
            var fi = _ioServices.GetFileInfo(entry.FullName);

            if (!fi.Exists)
            {
                return;
            }

            entry.CreationTime = fi.CreationTimeUtc.Conform();

            MIH.DvdWatches watches = null;
            try
            {
                watches = SerializerHelper.Deserialize <MIH.DvdWatches>(_ioServices, entry.FullName);
            }
            catch
            { }

            if (watches == null)
            {
                return;
            }

            if (string.IsNullOrWhiteSpace(entry.Title))
            {
                entry.Title = watches.Title;
            }

            if (watches.Watches?.Length > 0)
            {
                UpdateFromDvdWatches(entry, watches.Watches);
            }
        }
Example #2
0
        private void CreateCollectionFile(string folder, EpisodeTitle title)
        {
            var fileName = _ioServices.Path.Combine(folder, title.FileName + MediaInfoHelper.Constants.DvdProfilerFileExtension);

            var watches = new MIH.DvdWatches()
            {
                Title   = title.Title,
                Watches = title.Watches?.Select(ToDvdWatch).ToArray()
            };

            SerializerHelper.Serialize(_ioServices, fileName, watches);

            var fi = _ioServices.GetFileInfo(fileName);

            fi.CreationTime = title.PurchaseDate.Date;

            var fileEntry = new FileEntry()
            {
                FullName = fileName,
                Title    = title.Title,
            };

            _dataManager.TryCreateEntry(fileEntry);
        }