Beispiel #1
0
        private void RefreshUserSettings(IMediaLocation location)
        {
            VodcastContents parser = new VodcastContents(location.Contents);

            this.Url            = parser.Url;
            this.DownloadPolicy = parser.DownloadPolicy;
            this.FilesToRetain  = parser.FilesToRetain;
        }
Beispiel #2
0
        public void SaveSettings()
        {
            VodcastContents generator = new VodcastContents();

            generator.DownloadPolicy = DownloadPolicy;
            generator.FilesToRetain  = FilesToRetain;
            generator.Url            = Url;
            Kernel.Instance.GetLocation(Path).Contents = generator.Contents;
            Kernel.Instance.ItemRepository.SaveItem(this);
        }
Beispiel #3
0
        // Save a basic .vodcast file that the entity framework understands
        public void Save(string folder)
        {
            // find a file name based off title.
            string name     = Helper.RemoveInvalidFileChars(Title);
            string filename = Path.Combine(folder, name + ".vodcast");

            if (!File.Exists(filename))
            {
                VodcastContents generator = new VodcastContents();
                generator.Url            = url;
                generator.FilesToRetain  = -1;
                generator.DownloadPolicy = DownloadPolicy.Stream;
                File.WriteAllText(filename, generator.Contents);
            }
            else
            {
                throw new ApplicationException("Looks like we already have this podcast!");
            }
        }