update recording save path

This commit is contained in:
Luke Pulverenti 2015-08-20 19:55:23 -04:00
parent a6866fe878
commit 6d206bb9dc
5 changed files with 70 additions and 21 deletions

View File

@ -100,12 +100,7 @@ namespace MediaBrowser.Controller.Entities.Movies
/// <returns>System.String.</returns> /// <returns>System.String.</returns>
protected override string CreateUserDataKey() protected override string CreateUserDataKey()
{ {
var key = this.GetProviderId(MetadataProviders.Tmdb); var key = GetMovieUserDataKey(this);
if (string.IsNullOrWhiteSpace(key))
{
key = this.GetProviderId(MetadataProviders.Imdb);
}
if (string.IsNullOrWhiteSpace(key)) if (string.IsNullOrWhiteSpace(key))
{ {
@ -115,6 +110,18 @@ namespace MediaBrowser.Controller.Entities.Movies
return key; return key;
} }
public static string GetMovieUserDataKey(BaseItem movie)
{
var key = movie.GetProviderId(MetadataProviders.Tmdb);
if (string.IsNullOrWhiteSpace(key))
{
key = movie.GetProviderId(MetadataProviders.Imdb);
}
return key;
}
protected override async Task<bool> RefreshedOwnedItems(MetadataRefreshOptions options, List<FileSystemInfo> fileSystemChildren, CancellationToken cancellationToken) protected override async Task<bool> RefreshedOwnedItems(MetadataRefreshOptions options, List<FileSystemInfo> fileSystemChildren, CancellationToken cancellationToken)
{ {
var hasChanges = await base.RefreshedOwnedItems(options, fileSystemChildren, cancellationToken).ConfigureAwait(false); var hasChanges = await base.RefreshedOwnedItems(options, fileSystemChildren, cancellationToken).ConfigureAwait(false);

View File

@ -1,4 +1,5 @@
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Providers; using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.LiveTv; using MediaBrowser.Model.LiveTv;
@ -17,6 +18,15 @@ namespace MediaBrowser.Controller.LiveTv
/// <returns>System.String.</returns> /// <returns>System.String.</returns>
protected override string CreateUserDataKey() protected override string CreateUserDataKey()
{ {
if (IsMovie)
{
var key = Movie.GetMovieUserDataKey(this);
if (!string.IsNullOrWhiteSpace(key))
{
return key;
}
}
return GetClientTypeName() + "-" + Name; return GetClientTypeName() + "-" + Name;
} }

View File

@ -1,4 +1,5 @@
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Dto; using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
@ -40,6 +41,16 @@ namespace MediaBrowser.Controller.LiveTv
/// <returns>System.String.</returns> /// <returns>System.String.</returns>
protected override string CreateUserDataKey() protected override string CreateUserDataKey()
{ {
if (IsMovie)
{
var key = Movie.GetMovieUserDataKey(this);
if (!string.IsNullOrWhiteSpace(key))
{
return key;
}
}
var name = GetClientTypeName(); var name = GetClientTypeName();
if (!string.IsNullOrEmpty(ProgramId)) if (!string.IsNullOrEmpty(ProgramId))

View File

@ -495,10 +495,23 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
var info = GetProgramInfoFromCache(timer.ChannelId, timer.ProgramId); var info = GetProgramInfoFromCache(timer.ChannelId, timer.ProgramId);
var recordPath = RecordingPath; var recordPath = RecordingPath;
if (info.IsMovie) if (info.IsMovie)
{ {
recordPath = Path.Combine(recordPath, "Movies", _fileSystem.GetValidFilename(info.Name)); recordPath = Path.Combine(recordPath, "Movies", _fileSystem.GetValidFilename(info.Name));
} }
else if (info.IsSeries)
{
recordPath = Path.Combine(recordPath, "Series", _fileSystem.GetValidFilename(info.Name));
}
else if (info.IsKids)
{
recordPath = Path.Combine(recordPath, "Kids", _fileSystem.GetValidFilename(info.Name));
}
else if (info.IsSports)
{
recordPath = Path.Combine(recordPath, "Sports", _fileSystem.GetValidFilename(info.Name));
}
else else
{ {
recordPath = Path.Combine(recordPath, "TV", _fileSystem.GetValidFilename(info.Name)); recordPath = Path.Combine(recordPath, "TV", _fileSystem.GetValidFilename(info.Name));

View File

@ -1,6 +1,7 @@
using MediaBrowser.Common.Extensions; using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.LiveTv; using MediaBrowser.Controller.LiveTv;
using System; using System;
using System.Globalization;
namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
{ {
@ -36,26 +37,33 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
{ {
if (info == null) if (info == null)
{ {
return (timer.ProgramId + ".ts"); return timer.ProgramId + ".ts";
} }
var fancyName = info.Name;
if (info.ProductionYear != null) var name = info.Name;
if (info.IsSeries)
{ {
fancyName += "_(" + info.ProductionYear + ")"; if (info.SeasonNumber.HasValue && info.EpisodeNumber.HasValue)
}
if (info.IsSeries && !string.IsNullOrWhiteSpace(info.EpisodeTitle))
{ {
fancyName += "_" + info.EpisodeTitle.Replace("Season: ", "S").Replace(" Episode: ", "E"); name += string.Format(" S{0}E{1}", info.SeasonNumber.Value.ToString("00", CultureInfo.InvariantCulture), info.EpisodeNumber.Value.ToString("00", CultureInfo.InvariantCulture));
} }
if (info.IsHD ?? false) else if (info.OriginalAirDate.HasValue)
{ {
fancyName += "_HD"; name += " " + info.OriginalAirDate.Value.ToString("yyyy-MM-dd");
} }
if (info.OriginalAirDate != null) else if (!string.IsNullOrWhiteSpace(info.EpisodeTitle))
{ {
fancyName += "_" + info.OriginalAirDate.Value.ToString("yyyy-MM-dd"); name += " " + info.EpisodeTitle;
} }
return fancyName + ".ts"; }
else if (info.ProductionYear != null)
{
name += " (" + info.ProductionYear + ")";
}
return name + ".ts";
} }
} }
} }