public void PathTest() { var target = new MediaPathFileModel(); target.PathAndFileName = @"c:\stuff\folder\this is a filename.avi"; Assert.IsTrue(target.FilenameExt == ".avi"); Assert.IsTrue(target.FilenameWithOutExt == "this is a filename"); Assert.IsTrue(target.Path == @"c:\stuff\folder\"); }
/// <summary> /// Build a MediaPathFileModel /// </summary> /// <param name="path">The file path.</param> /// <param name="type">The MediaPathFileType type.</param> /// <param name="nameBy">The AddFolderType name by.</param> /// <param name="scraperGroup">The scraper Group.</param> /// <param name="defaultSource">The default Source.</param> /// <returns>MediaPathFileModel object</returns> public static MediaPathFileModel Add( string path, MediaPathFileType type, AddFolderType nameBy, string scraperGroup, string defaultSource) { var newMediaPathFileModel = new MediaPathFileModel { PathAndFileName = path, Type = type, MediaPathType = nameBy, ScraperGroup = scraperGroup, DefaultVideoSource = defaultSource }; return(newMediaPathFileModel); }
/// <summary> /// Build a MediaPathFileModel /// </summary> /// <param name="path">The file path.</param> /// <param name="type">The MediaPathFileType type.</param> /// <param name="nameBy">The AddFolderType name by.</param> /// <param name="scraperGroup">The scraper Group.</param> /// <param name="defaultSource">The default Source.</param> /// <returns>MediaPathFileModel object</returns> public static MediaPathFileModel Add( string path, MediaPathFileType type, AddFolderType nameBy, string scraperGroup, string defaultSource) { var newMediaPathFileModel = new MediaPathFileModel { PathAndFileName = path, Type = type, MediaPathType = nameBy, ScraperGroup = scraperGroup, DefaultVideoSource = defaultSource }; return newMediaPathFileModel; }
/// <summary> /// The add to media collection. /// </summary> /// <param name="fileModel"> /// The file model. /// </param> /// <param name="order"> /// The order. /// </param> public void AddToMediaCollection(MediaPathFileModel fileModel, int order = 1) { this.Media.Add(new MediaModel { PathAndFilename = fileModel.PathAndFileName, Order = 1 }); }
/// <summary> /// The add to media collection. /// </summary> /// <param name="fileModel"> /// The file model. /// </param> /// <param name="order"> /// The order. /// </param> public void AddToMediaCollection(MediaPathFileModel fileModel, int order = 1) { this.Media.Add(new MediaModel { FileModel = fileModel, Order = 1 }); }
private MediaPathFileModel CreateTextMediaPathFileModel() { var mediaPathFileModel = new MediaPathFileModel(); mediaPathFileModel.PathAndFileName = @"D:\Movies\Toy Story 3\Toy.Story.3.TC.XviD-FLAWL3SS.avi"; return mediaPathFileModel; }