aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Entities/MusicVideo.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-12-08 23:57:18 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-12-08 23:57:18 -0500
commit4548e6598def249d4b0fe4f4f12e2fa16d4f1e3c (patch)
tree781febcb168647c37f027e7893adbb1b9c3dbfc1 /MediaBrowser.Controller/Entities/MusicVideo.cs
parent5eb44c42c586af34dd16efc76240d0d6c8e02069 (diff)
support dvd without video_ts folder
Diffstat (limited to 'MediaBrowser.Controller/Entities/MusicVideo.cs')
-rw-r--r--MediaBrowser.Controller/Entities/MusicVideo.cs36
1 files changed, 36 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Entities/MusicVideo.cs b/MediaBrowser.Controller/Entities/MusicVideo.cs
index 015e4b4ae..d7cd62aa6 100644
--- a/MediaBrowser.Controller/Entities/MusicVideo.cs
+++ b/MediaBrowser.Controller/Entities/MusicVideo.cs
@@ -89,5 +89,41 @@ namespace MediaBrowser.Controller.Entities
{
return GetItemLookupInfo<MusicVideoInfo>();
}
+
+ public override bool BeforeMetadataRefresh()
+ {
+ var hasChanges = base.BeforeMetadataRefresh();
+
+ if (!ProductionYear.HasValue)
+ {
+ var info = LibraryManager.ParseName(Name);
+
+ var yearInName = info.Year;
+
+ if (yearInName.HasValue)
+ {
+ ProductionYear = yearInName;
+ hasChanges = true;
+ }
+ else
+ {
+ // Try to get the year from the folder name
+ if (!IsInMixedFolder)
+ {
+ info = LibraryManager.ParseName(System.IO.Path.GetFileName(ContainingFolderPath));
+
+ yearInName = info.Year;
+
+ if (yearInName.HasValue)
+ {
+ ProductionYear = yearInName;
+ hasChanges = true;
+ }
+ }
+ }
+ }
+
+ return hasChanges;
+ }
}
}