예제 #1
0
 public File(SVR_VideoLocal vl)
 {
     ID     = vl.VideoLocalID;
     Size   = vl.FileSize;
     Hashes = new Hashes
     {
         ED2K  = vl.Hash,
         MD5   = vl.MD5,
         CRC32 = vl.CRC32,
         SHA1  = vl.SHA1
     };
     RoundedStandardResolution = FileQualityFilter.GetResolution(vl);
     Locations = vl.Places.Select(a => new Location
     {
         ImportFolderID = a.ImportFolderID,
         RelativePath   = a.FilePath,
         Accessible     = a.GetFile() != null
     }).ToList();
 }
예제 #2
0
        public File(HttpContext ctx, SVR_VideoLocal vl)
        {
            ID     = vl.VideoLocalID;
            Size   = vl.FileSize;
            Hashes = new Hashes
            {
                ED2K  = vl.Hash,
                MD5   = vl.MD5,
                CRC32 = vl.CRC32,
                SHA1  = vl.SHA1
            };
            RoundedStandardResolution = FileQualityFilter.GetResolution(vl);
            Locations = vl.Places.Select(a => new Location
            {
                ImportFolderID = a.ImportFolderID,
                RelativePath   = a.FilePath,
                Accessible     = a.GetFile() != null
            }).ToList();
            Created = vl.DateTimeCreated;
            var ur = vl.GetUserRecord(ctx?.GetUser()?.JMMUserID ?? 0);

            ResumePosition = ur?.ResumePosition ?? 0;
            Watched        = ur?.WatchedDate;
        }
예제 #3
0
 /// <summary>
 /// This method attempts to take a video resolution, and return something that is closer to a standard
 /// </summary>
 /// <param name="res"></param>
 /// <returns></returns>
 public static string GetStandardisedVideoResolution(string res) => FileQualityFilter.GetResolution(res) ?? res;
예제 #4
0
 private static string GetResolution(int width, int height)
 {
     return(FileQualityFilter.GetResolution(Tuple.Create(width, height)));
 }