Example #1
0
        public MovieAtStorage AddStorageLocation(StorageLocation sl, string relativePath, string samplePath, string cleanedName)
        {
            if (!MovieAtStorages.Any())
                AddedAt = DateTime.Now;

            var mas = new MovieAtStorage()
            {
                RelativePath = relativePath,
                SampleRelativePath = samplePath,
                StorageLocation = sl,
                CleanedName = cleanedName
            };

            MovieAtStorages.Add(mas);
            return mas;
        }
Example #2
0
        private ActionResult DownloadMovie(MovieAtStorage mas)
        {
            if (string.IsNullOrEmpty(mas.StorageLocation.Rebase))
                throw new InvalidOperationException("No rebase location");

            return Redirect(mas.StorageLocation.Rebase + mas.RelativePath.Replace("\\", "/"));
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the MovieAtStorages EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToMovieAtStorages(MovieAtStorage movieAtStorage)
 {
     base.AddObject("MovieAtStorages", movieAtStorage);
 }
 /// <summary>
 /// Create a new MovieAtStorage object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="relativePath">Initial value of the RelativePath property.</param>
 /// <param name="cleanedName">Initial value of the CleanedName property.</param>
 /// <param name="ignore">Initial value of the Ignore property.</param>
 public static MovieAtStorage CreateMovieAtStorage(global::System.Int32 id, global::System.String relativePath, global::System.String cleanedName, global::System.Boolean ignore)
 {
     MovieAtStorage movieAtStorage = new MovieAtStorage();
     movieAtStorage.Id = id;
     movieAtStorage.RelativePath = relativePath;
     movieAtStorage.CleanedName = cleanedName;
     movieAtStorage.Ignore = ignore;
     return movieAtStorage;
 }