private string MovieTitle(string title) { var theTitle = string.Empty; try { Logger.Debug("Extracting Movie title from " + title); var mi = new MediaInfo(title); mi.Analyse(); Logger.Debug(" Movie title is " + mi.Title); theTitle = mi.Title; } catch (PathTooLongException ex) { Logger.Error(string.Format("{0}:- Title has {1} characters", ex.Message, title.Length )); theTitle = title.Substring(0, 100); } catch (System.Exception) { throw; } return theTitle; }
public void TestCollectorHasIt() { var mi = new MediaInfo(@".\TestFolder\Judge.Judy.S14E157.2010.02.25.mp4"); mi.Analyse(); var sut = new Collector(); var hasIt = sut.HaveIt(mi); Assert.IsTrue(hasIt); }
public void TestAddingToCollection() { var mi = new MediaInfo(@".\TestFolder\Judge.Judy.S14E157.2010.02.25.mp5"); mi.Analyse(); var sut = new Collector(); var result = sut.AddToTvCollection(mi); Assert.IsTrue(result.Equals(sut.LatestAddition)); }
public void TestMacWorldtIsMag() { var testCandidates = Directory.GetFiles(".//Output//DL//", "Macworld USA - February 2015.pdf", SearchOption.AllDirectories).ToList(); foreach (var item in testCandidates) { var mi = new MediaInfo(item); mi.MagazineFolder = ".\\Output\\Magazines\\"; mi.Analyse(); Assert.IsTrue(mi.IsMagazine); } }
public void TestIsNotaMag() { var testCandidates = Directory.GetFiles(".//Output//DL//", "Apress - Beginning ASP.NET 4.pdf", SearchOption.AllDirectories).ToList(); foreach (var item in testCandidates) { var mi = new MediaInfo(item); mi.MagazineFolder = ".\\Output\\Magazines\\"; mi.Analyse(); Assert.IsFalse(mi.IsMagazine); Assert.IsTrue(mi.IsBook); } }
public void TestMediaInfo2() { var sut = new MediaInfo(@".\TestFolder\Game.of.Thrones.S04E07.HDTV.x264-KILLERS.[VTV].mp4"); sut.Analyse(); Assert.IsTrue(sut.IsTV); Assert.IsTrue(sut.Season == 4); Assert.IsTrue(sut.Episode == 7); Assert.IsTrue(sut.Title == "Game of Thrones"); }
private string TvTitle(string title) { Logger.Trace("Extracting TV title from " + title); var mi = new MediaInfo(title); mi.Analyse(); Logger.Debug("TV title is " + mi.TvTitle); return mi.TvTitle; }
public void TestTvHauntingAustralia() { var testCandidates = Directory.GetFiles(".//Output//DL//", "Haunting-Australia.S01E01.Woodford.Academy.HDTV.x264-SPASM.mp4", SearchOption.AllDirectories).ToList(); foreach (var item in testCandidates) { var mi = new MediaInfo(item); mi.Analyse(); Assert.IsTrue(mi.IsTV); Assert.IsFalse(mi.IsMovie); Assert.IsTrue(mi.Episode.Equals(1)); } }
public void TestTvCriminalMinds() { var testCandidates = Directory.GetFiles(".//Output//DL//", "criminal minds 1017 hdtv lol.mp4", SearchOption.AllDirectories).ToList(); foreach (var item in testCandidates) { var mi = new MediaInfo(item); mi.Analyse(); Assert.IsTrue(mi.IsTV); Assert.IsFalse(mi.IsMovie); Assert.IsTrue(mi.Season.Equals(10)); Assert.IsTrue(mi.Episode.Equals(17)); } }
public void TestMediaInfoTvWord() { var testCandidates = Directory.GetFiles(".//Output//DL//", "married_with_children.1x01.pilot.dvdrip_xvid-fov.avi", SearchOption.AllDirectories).ToList(); foreach (var item in testCandidates) { var mi = new MediaInfo(item); mi.Analyse(); var tvWord = mi.IsTvWord("1x01"); Assert.IsTrue(tvWord); } }
public void TestMediaInfoGoodnightSweetheart() { var testCandidates = Directory.GetFiles(".//Output//DL//", "Goodnight Sweetheart - S01 - E01 - Rites of Passage.avi", SearchOption.AllDirectories).ToList(); foreach (var item in testCandidates) { var mi = new MediaInfo(item); mi.Analyse(); Assert.IsTrue(mi.Season.Equals(0)); // basically we dont want an exception } }
public void TestMediaInfoAlternatTvWord() { var testCandidates = Directory.GetFiles(".//Output//DL//", "arrow.309.hdtv-lol.mp4", SearchOption.AllDirectories).ToList(); foreach (var item in testCandidates) { var mi = new MediaInfo(item); mi.Analyse(); // Numbers are stripped out of titles Assert.IsTrue(mi.Title.Equals("arrow")); Assert.IsTrue(mi.IsTV); Assert.IsTrue(mi.Season == 3); Assert.IsTrue(mi.Episode == 9); } }
public void TestMediaInfo720p() { var testCandidates = Directory.GetFiles(".//Output//DL//", "canadas.worst.driver.s10e08.720p.HDTV.x264.mp4", SearchOption.AllDirectories).ToList(); foreach (var item in testCandidates) { var mi = new MediaInfo(item); mi.Analyse(); // Numbers are stripped out of titles Assert.IsTrue(mi.Title.Equals("canadas worst driver")); Assert.IsTrue(mi.IsTV); Assert.IsTrue(mi.Season == 10); Assert.IsTrue(mi.Episode == 8); } }
public override string DoJob() { var finishedMessage = string.Empty; try { var itemCount = 0; GetCandidates(); var collector = new Collector(); foreach (var f in Candidates) { File.SetAttributes(f, FileAttributes.Normal); itemCount++; Logger.Trace( string.Format( "Candidate: {0} ", f ) ); var mi = new MediaInfo(f); if ( !mi.IsValid ) { Logger.Trace( string.Format( "{0} is invalid", f) ); continue; } if (!mi.HasValidExt()) { Logger.Trace( string.Format( "{0} has invalid ext", f ) ); continue; } mi.MagazineFolder = MagazineCollectionFolder; mi.Analyse(); if (mi.IsTV) { if (!collector.HaveIt( mi )) continue; var newFile = collector.AddToTvCollection(mi); Logger.Info( string.Format( " Adding TV - {0} ", newFile)); } else if (mi.IsMagazine) { var newFile = collector.MoveToMagQueue(mi); Logger.Info(string.Format(" Queing Mag - {0} ", newFile)); } else if (mi.IsBook) { var newFile = collector.MoveToViewQueue(mi); Logger.Info( string.Format( " Queing Book - {0} ", newFile)); } else if ( mi.IsNfl ) { var newFile = collector.AddToNflCollection( mi ); Logger.Info( string.Format( " Adding NFL - {0} ", newFile ) ); } else if ( mi.IsSoccer ) { var newFile = collector.AddToSoccerCollection( mi ); Logger.Info( string.Format( " Adding Soccer - {0} ", newFile ) ); } else if ( mi.IsMovie ) { var newFile = collector.AddToMovieCollection( mi ); Logger.Info( string.Format( " Adding Movie - {0} ", newFile ) ); } else { Logger.Trace( string.Format( " Not Recognised {0}", f ) ); } } finishedMessage = string.Format("{0} items processed", itemCount); } catch (Exception ex) { Logger.Error(ex.StackTrace); throw; } Logger.Info(" {0}", finishedMessage); return finishedMessage; }
public void TestMediaInfoContainsNumber() { var sut = new MediaInfo(@".\TestFolder\Judge.Judy.S14E157.2010.02.25.mp4"); sut.Analyse(); Assert.IsTrue(sut.ContainsNumber("SGD22")); Assert.IsFalse(sut.ContainsNumber("Steve")); }
public void TestMediaInfoPdf() { var testCandidates = Directory.GetFiles(".//Output//DL//", "Computeractive UK Issue 438 - December 10, 2014.pdf", SearchOption.AllDirectories).ToList(); foreach (var item in testCandidates) { var mi = new MediaInfo(item); mi.MagazineFolder = ".//Output//Magazines//"; mi.Analyse(); // Numbers are stripped out of titles Assert.IsTrue(mi.Title.Equals("Computeractive UK Issue")); Assert.IsFalse(mi.IsTV); Assert.IsTrue(mi.IsMagazine); } }
public void TestMediaInfoSliders() { var testCandidates = Directory.GetFiles(".//Output//DL//", "Sliders.1x01_1x02.Pilot.AC3.DVDRip_XviD-FoV.avi", SearchOption.AllDirectories).ToList(); foreach (var item in testCandidates) { var mi = new MediaInfo(item); mi.Analyse(); Assert.IsTrue(mi.Episode.Equals(1)); } }
public void TestMediaInfoJudgeJudy() { var testCandidates = Directory.GetFiles(".//Output//DL//", "judge.judy.2015.04.28b.mackey.vs.peak.hdtv.x264-daview.mp4", SearchOption.AllDirectories).ToList(); foreach (var item in testCandidates) { var mi = new MediaInfo(item); mi.Analyse(); // in progress files are ignored Assert.IsTrue(mi.Title.Equals("Judge Judy")); Assert.IsTrue(mi.Season.Equals( 20 )); Assert.IsTrue(mi.IsTV); Assert.IsFalse(mi.IsMovie); } }
public void TestMediaInfoTvSample() { var testCandidates = Directory.GetFiles(".//Output//DL//", "Sliders.S02E04.Sample.avi", SearchOption.AllDirectories).ToList(); foreach (var item in testCandidates) { var mi = new MediaInfo(item); mi.Analyse(); // Numbers are stripped out of titles Assert.IsFalse(mi.IsTV); Assert.IsFalse(mi.IsMovie); } }
public void TestMediaInfoJudgeJudySeason20() { var testCandidates = Directory.GetFiles( ".//Output//DL//", "Judge Judy 2016 07 06 S20E220.mkv", SearchOption.AllDirectories ).ToList(); foreach ( var item in testCandidates ) { var mi = new MediaInfo( item ); mi.Analyse(); // in progress files are ignored Assert.IsTrue( mi.Title.Equals( "Judge Judy" ), "Title is not Judge Judy" ); Assert.IsTrue( mi.Season.Equals( 20 ), "Season is not 20" ); Assert.IsTrue( mi.IsTV, "Not TV" ); Assert.IsFalse( mi.IsMovie, "Is movie" ); } }
public void TestMediaInfoTvWordType3() { var testCandidates = Directory.GetFiles(".//Output//DL//", "married_with_children.1x02.pilot.dvdrip_xvid-fov.avi", SearchOption.AllDirectories).ToList(); foreach (var item in testCandidates) { var mi = new MediaInfo(item); mi.Analyse(); // Numbers are stripped out of titles Assert.IsTrue(mi.Title.Equals("married with children")); Assert.IsTrue(mi.IsTV); Assert.IsTrue(mi.Season == 1); Assert.IsTrue(mi.Episode == 2); } }
public void TestMediaInfoMagazineAnalysis() { var testCandidates = Directory.GetFiles(".//Output//DL//", "PC Format 2014-12.pdf", SearchOption.AllDirectories).ToList(); foreach (var item in testCandidates) { var mi = new MediaInfo(item) { MagazineFolder = ".//Output//Magazines//" }; mi.Analyse(); Assert.IsFalse(mi.IsNfl); Assert.IsFalse(mi.IsBook); Assert.IsFalse(mi.IsTV); Assert.IsFalse(mi.IsMovie); Assert.IsTrue(mi.IsMagazine); } }
public void TestTvFlash() { var testCandidates = Directory.GetFiles(".//Output//DL//", "the.flash.2014.116.hdtv-lol.mp4 ", SearchOption.AllDirectories).ToList(); foreach (var item in testCandidates) { var mi = new MediaInfo(item); mi.Analyse(); Assert.IsTrue(mi.IsTV); Assert.IsFalse(mi.IsMovie); } }
public void TestMediaInfoMagList() { var testCandidates = Directory.GetFiles(".//Output//DL//", "PC Format 2014-12.pdf", SearchOption.AllDirectories).ToList(); foreach (var item in testCandidates) { var mi = new MediaInfo(item); mi.MagazineFolder = ".\\Output\\Magazines\\"; mi.GetMagList(); mi.Analyse(); Assert.IsTrue(mi.Magazines.Count > 0); Assert.IsTrue(mi.IsMagazine); } }
public void TestTvHousewives() { var testCandidates = Directory.GetFiles(".//Output//DL//", "The_Real_Housewives_of_Atlanta_S07E19[480i_HDTV_H.264_mp4].mp4", SearchOption.AllDirectories).ToList(); foreach (var item in testCandidates) { var mi = new MediaInfo(item); mi.Analyse(); Assert.IsTrue(mi.IsTV); Assert.IsFalse(mi.IsMovie); Assert.IsTrue(mi.Season.Equals(7)); Assert.IsTrue(mi.Episode.Equals(19)); } }
public void TestMediaInfoMovie() { var testCandidates = Directory.GetFiles(".//Output//DL//", "American.Sniper.2014.720p.BRRip.XviD.AC3.SANTi.avi", SearchOption.AllDirectories).ToList(); foreach (var item in testCandidates) { var mi = new MediaInfo(item); mi.Analyse(); // Numbers are stripped out of titles Assert.IsFalse(mi.IsTV); Assert.IsTrue(mi.IsMovie); Assert.IsTrue(mi.Title.Equals("American Sniper [2014]")); } }
public void TestMediaInfo() { var testCandidates = Directory.GetFiles(".//Output//DL//", "Mean Machine.mp4", SearchOption.AllDirectories).ToList(); foreach (var item in testCandidates) { var mi = new MediaInfo(item); mi.Analyse(); Assert.IsTrue(mi.IsMovie); } }
public void TestMediaInfoNCIS() { var testCandidates = Directory.GetFiles(".//Output//DL//", "ncis.1217.hdtv-lol.mp4", SearchOption.AllDirectories).ToList(); foreach (var item in testCandidates) { var mi = new MediaInfo(item); mi.Analyse(); // in progress files are ignored Assert.IsTrue(mi.IsTV); Assert.IsFalse(mi.IsMovie); } }
public void TestMediaInfoNFLAnalysis() { var testCandidates = Directory.GetFiles(".//Output//DL//", "NFL WK 15 12-14-2014 49ers at Seahawks (Condensed) (1280x720) [Phr0stY].mkv", SearchOption.AllDirectories).ToList(); foreach (var item in testCandidates) { var mi = new MediaInfo(item); mi.Analyse(); Assert.IsTrue(mi.IsNfl); Assert.IsFalse(mi.IsBook); Assert.IsFalse(mi.IsTV); Assert.IsFalse(mi.IsMovie); } }
public void TestMediaInfo() { var sut = new MediaInfo(@".\TestFolder\Judge.Judy.S14E157.2010.02.25.mp4"); sut.Analyse(); Assert.IsFalse(sut.IsMovie); Assert.IsTrue(sut.IsTV); Assert.IsTrue(sut.Season == 14); Assert.IsTrue(sut.Episode == 157); Assert.IsTrue(sut.Title == "Judge Judy"); }