aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-10-13 01:44:20 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-10-13 01:44:20 -0400
commitbc656edf4ff5cc60b246b6d59f7483610677ce69 (patch)
tree1b37dcd23f6ece1051c3ab3ce1d793b9317229ec
parent66ad10348fe9383df7b939c2de5a93c044ec351d (diff)
update resolved video titles
-rw-r--r--Emby.Server.Implementations/Emby.Server.Implementations.csproj2
-rw-r--r--Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs28
-rw-r--r--Emby.Server.Implementations/Notifications/CoreNotificationTypes.cs12
-rw-r--r--MediaBrowser.Api/ItemUpdateService.cs20
-rw-r--r--MediaBrowser.Api/LiveTv/LiveTvService.cs13
-rw-r--r--MediaBrowser.Controller/LiveTv/ILiveTvManager.cs10
-rw-r--r--MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs5
-rw-r--r--MediaBrowser.Model/Dto/MediaSourceInfo.cs1
-rw-r--r--MediaBrowser.Model/LiveTv/LiveTvOptions.cs1
9 files changed, 38 insertions, 54 deletions
diff --git a/Emby.Server.Implementations/Emby.Server.Implementations.csproj b/Emby.Server.Implementations/Emby.Server.Implementations.csproj
index b3fdead84..4f5471bc3 100644
--- a/Emby.Server.Implementations/Emby.Server.Implementations.csproj
+++ b/Emby.Server.Implementations/Emby.Server.Implementations.csproj
@@ -681,11 +681,9 @@
<EmbeddedResource Include="Localization\Core\ca.json" />
<EmbeddedResource Include="Localization\Core\cs.json" />
<EmbeddedResource Include="Localization\Core\da.json" />
- <EmbeddedResource Include="Localization\Core\de-DE.json" />
<EmbeddedResource Include="Localization\Core\de.json" />
<EmbeddedResource Include="Localization\Core\en-GB.json" />
<EmbeddedResource Include="Localization\Core\es-AR.json" />
- <EmbeddedResource Include="Localization\Core\es-ES.json" />
<EmbeddedResource Include="Localization\Core\es-MX.json" />
<EmbeddedResource Include="Localization\Core\es.json" />
<EmbeddedResource Include="Localization\Core\fr-CA.json" />
diff --git a/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs
index 82f42c745..fc5cab0a0 100644
--- a/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs
+++ b/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs
@@ -69,13 +69,13 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
if (string.Equals(collectionType, CollectionType.MusicVideos, StringComparison.OrdinalIgnoreCase))
{
- return ResolveVideos<MusicVideo>(parent, files, directoryService, true, collectionType);
+ return ResolveVideos<MusicVideo>(parent, files, directoryService, true, collectionType, false);
}
if (string.Equals(collectionType, CollectionType.HomeVideos, StringComparison.OrdinalIgnoreCase) ||
string.Equals(collectionType, CollectionType.Photos, StringComparison.OrdinalIgnoreCase))
{
- return ResolveVideos<Video>(parent, files, directoryService, false, collectionType);
+ return ResolveVideos<Video>(parent, files, directoryService, false, collectionType, false);
}
if (string.IsNullOrWhiteSpace(collectionType))
@@ -83,7 +83,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
// Owned items should just use the plain video type
if (parent == null)
{
- return ResolveVideos<Video>(parent, files, directoryService, false, collectionType);
+ return ResolveVideos<Video>(parent, files, directoryService, false, collectionType, false);
}
if (parent is Series || parent.GetParents().OfType<Series>().Any())
@@ -91,18 +91,18 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
return null;
}
- return ResolveVideos<Movie>(parent, files, directoryService, false, collectionType);
+ return ResolveVideos<Movie>(parent, files, directoryService, false, collectionType, true);
}
if (string.Equals(collectionType, CollectionType.Movies, StringComparison.OrdinalIgnoreCase))
{
- return ResolveVideos<Movie>(parent, files, directoryService, true, collectionType);
+ return ResolveVideos<Movie>(parent, files, directoryService, true, collectionType, true);
}
return null;
}
- private MultiItemResolverResult ResolveVideos<T>(Folder parent, IEnumerable<FileSystemMetadata> fileSystemEntries, IDirectoryService directoryService, bool suppportMultiEditions, string collectionType)
+ private MultiItemResolverResult ResolveVideos<T>(Folder parent, IEnumerable<FileSystemMetadata> fileSystemEntries, IDirectoryService directoryService, bool suppportMultiEditions, string collectionType, bool parseName)
where T : Video, new()
{
var files = new List<FileSystemMetadata>();
@@ -158,7 +158,9 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
Path = video.Files[0].Path,
IsInMixedFolder = isInMixedFolder,
ProductionYear = video.Year,
- Name = video.Name,
+ Name = parseName ?
+ video.Name :
+ Path.GetFileName(video.Files[0].Path),
AdditionalParts = video.Files.Skip(1).Select(i => i.Path).ToArray(),
LocalAlternateVersions = video.AlternateVersions.Select(i => i.Path).ToArray()
};
@@ -214,12 +216,12 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
if (string.Equals(collectionType, CollectionType.MusicVideos, StringComparison.OrdinalIgnoreCase))
{
- return FindMovie<MusicVideo>(args.Path, args.Parent, files, args.DirectoryService, collectionType, true);
+ return FindMovie<MusicVideo>(args.Path, args.Parent, files, args.DirectoryService, collectionType, true, false);
}
if (string.Equals(collectionType, CollectionType.HomeVideos, StringComparison.OrdinalIgnoreCase))
{
- return FindMovie<Video>(args.Path, args.Parent, files, args.DirectoryService, collectionType, false);
+ return FindMovie<Video>(args.Path, args.Parent, files, args.DirectoryService, collectionType, false, false);
}
if (string.IsNullOrEmpty(collectionType))
@@ -237,13 +239,13 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
}
{
- return FindMovie<Movie>(args.Path, args.Parent, files, args.DirectoryService, collectionType, true);
+ return FindMovie<Movie>(args.Path, args.Parent, files, args.DirectoryService, collectionType, true, true);
}
}
if (string.Equals(collectionType, CollectionType.Movies, StringComparison.OrdinalIgnoreCase))
{
- return FindMovie<Movie>(args.Path, args.Parent, files, args.DirectoryService, collectionType, true);
+ return FindMovie<Movie>(args.Path, args.Parent, files, args.DirectoryService, collectionType, true, true);
}
return null;
@@ -359,7 +361,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns>Movie.</returns>
- private T FindMovie<T>(string path, Folder parent, List<FileSystemMetadata> fileSystemEntries, IDirectoryService directoryService, string collectionType, bool allowFilesAsFolders)
+ private T FindMovie<T>(string path, Folder parent, List<FileSystemMetadata> fileSystemEntries, IDirectoryService directoryService, string collectionType, bool allowFilesAsFolders, bool parseName)
where T : Video, new()
{
var multiDiscFolders = new List<FileSystemMetadata>();
@@ -413,7 +415,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
!string.Equals(collectionType, CollectionType.Photos) &&
!string.Equals(collectionType, CollectionType.MusicVideos);
- var result = ResolveVideos<T>(parent, fileSystemEntries, directoryService, supportsMultiVersion, collectionType) ??
+ var result = ResolveVideos<T>(parent, fileSystemEntries, directoryService, supportsMultiVersion, collectionType, parseName) ??
new MultiItemResolverResult();
if (result.Items.Count == 1)
diff --git a/Emby.Server.Implementations/Notifications/CoreNotificationTypes.cs b/Emby.Server.Implementations/Notifications/CoreNotificationTypes.cs
index 849e02d81..b00b5d43b 100644
--- a/Emby.Server.Implementations/Notifications/CoreNotificationTypes.cs
+++ b/Emby.Server.Implementations/Notifications/CoreNotificationTypes.cs
@@ -160,7 +160,7 @@ namespace Emby.Server.Implementations.Notifications
Update(type);
}
- var systemName = _localization.GetLocalizedString("CategorySystem");
+ var systemName = _localization.GetLocalizedString("System");
return knownTypes.OrderByDescending(i => string.Equals(i.Category, systemName, StringComparison.OrdinalIgnoreCase))
.ThenBy(i => i.Category)
@@ -175,23 +175,23 @@ namespace Emby.Server.Implementations.Notifications
if (note.Type.IndexOf("Playback", StringComparison.OrdinalIgnoreCase) != -1)
{
- note.Category = _localization.GetLocalizedString("CategoryUser");
+ note.Category = _localization.GetLocalizedString("User");
}
else if (note.Type.IndexOf("Plugin", StringComparison.OrdinalIgnoreCase) != -1)
{
- note.Category = _localization.GetLocalizedString("CategoryPlugin");
+ note.Category = _localization.GetLocalizedString("Plugin");
}
else if (note.Type.IndexOf("CameraImageUploaded", StringComparison.OrdinalIgnoreCase) != -1)
{
- note.Category = _localization.GetLocalizedString("CategorySync");
+ note.Category = _localization.GetLocalizedString("Sync");
}
else if (note.Type.IndexOf("UserLockedOut", StringComparison.OrdinalIgnoreCase) != -1)
{
- note.Category = _localization.GetLocalizedString("CategoryUser");
+ note.Category = _localization.GetLocalizedString("User");
}
else
{
- note.Category = _localization.GetLocalizedString("CategorySystem");
+ note.Category = _localization.GetLocalizedString("System");
}
}
}
diff --git a/MediaBrowser.Api/ItemUpdateService.cs b/MediaBrowser.Api/ItemUpdateService.cs
index 90cf2d1d1..a55741d7d 100644
--- a/MediaBrowser.Api/ItemUpdateService.cs
+++ b/MediaBrowser.Api/ItemUpdateService.cs
@@ -124,24 +124,24 @@ namespace MediaBrowser.Api
{
list.Add(new NameValuePair
{
- Name = "FolderTypeInherit",
+ Name = "Inherit",
Value = ""
});
}
list.Add(new NameValuePair
{
- Name = "FolderTypeMovies",
+ Name = "Movies",
Value = "movies"
});
list.Add(new NameValuePair
{
- Name = "FolderTypeMusic",
+ Name = "Music",
Value = "music"
});
list.Add(new NameValuePair
{
- Name = "FolderTypeTvShows",
+ Name = "Shows",
Value = "tvshows"
});
@@ -149,29 +149,29 @@ namespace MediaBrowser.Api
{
list.Add(new NameValuePair
{
- Name = "FolderTypeBooks",
+ Name = "Books",
Value = "books"
});
list.Add(new NameValuePair
{
- Name = "FolderTypeGames",
+ Name = "Games",
Value = "games"
});
}
list.Add(new NameValuePair
{
- Name = "FolderTypeHomeVideos",
+ Name = "HomeVideos",
Value = "homevideos"
});
list.Add(new NameValuePair
{
- Name = "FolderTypeMusicVideos",
+ Name = "MusicVideos",
Value = "musicvideos"
});
list.Add(new NameValuePair
{
- Name = "FolderTypePhotos",
+ Name = "Photos",
Value = "photos"
});
@@ -179,7 +179,7 @@ namespace MediaBrowser.Api
{
list.Add(new NameValuePair
{
- Name = "FolderTypeMixed",
+ Name = "MixedContent",
Value = ""
});
}
diff --git a/MediaBrowser.Api/LiveTv/LiveTvService.cs b/MediaBrowser.Api/LiveTv/LiveTvService.cs
index f46c3e50f..1ae7323dc 100644
--- a/MediaBrowser.Api/LiveTv/LiveTvService.cs
+++ b/MediaBrowser.Api/LiveTv/LiveTvService.cs
@@ -947,9 +947,9 @@ namespace MediaBrowser.Api.LiveTv
public object Get(GetChannel request)
{
- var user = string.IsNullOrWhiteSpace(request.UserId) ? null : _userManager.GetUserById(request.UserId);
+ var user = _userManager.GetUserById(request.UserId);
- var item = _libraryManager.GetItemById(request.Id);
+ var item = string.IsNullOrEmpty(request.Id) ? user.RootFolder : _libraryManager.GetItemById(request.Id);
var dtoOptions = GetDtoOptions(_authContext, request);
@@ -1098,12 +1098,13 @@ namespace MediaBrowser.Api.LiveTv
public async Task<object> Get(GetRecording request)
{
- var user = string.IsNullOrEmpty(request.UserId) ? null : _userManager.GetUserById(request.UserId);
+ var user = _userManager.GetUserById(request.UserId);
- var options = new DtoOptions();
- options.DeviceId = _authContext.GetAuthorizationInfo(Request).DeviceId;
+ var item = string.IsNullOrEmpty(request.Id) ? user.RootFolder : _libraryManager.GetItemById(request.Id);
- var result = await _liveTvManager.GetRecording(request.Id, options, CancellationToken.None, user).ConfigureAwait(false);
+ var dtoOptions = GetDtoOptions(_authContext, request);
+
+ var result = _dtoService.GetBaseItemDto(item, dtoOptions, user);
return ToOptimizedSerializedResultUsingCache(result);
}
diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs
index 56f2353f1..4934cc1ca 100644
--- a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs
+++ b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs
@@ -76,16 +76,6 @@ namespace MediaBrowser.Controller.LiveTv
void AddParts(IEnumerable<ILiveTvService> services, IEnumerable<ITunerHost> tunerHosts, IEnumerable<IListingsProvider> listingProviders);
/// <summary>
- /// Gets the recording.
- /// </summary>
- /// <param name="id">The identifier.</param>
- /// <param name="options">The options.</param>
- /// <param name="cancellationToken">The cancellation token.</param>
- /// <param name="user">The user.</param>
- /// <returns>Task{RecordingInfoDto}.</returns>
- Task<BaseItemDto> GetRecording(string id, DtoOptions options, CancellationToken cancellationToken, User user = null);
-
- /// <summary>
/// Gets the timer.
/// </summary>
/// <param name="id">The identifier.</param>
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
index 506fce3ca..ad131064c 100644
--- a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
+++ b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
@@ -127,11 +127,6 @@ namespace MediaBrowser.Controller.MediaEncoding
}
}
- public bool EnableMpDecimate
- {
- get { return MediaSource.EnableMpDecimate; }
- }
-
public string AlbumCoverPath { get; set; }
public string InputAudioSync { get; set; }
diff --git a/MediaBrowser.Model/Dto/MediaSourceInfo.cs b/MediaBrowser.Model/Dto/MediaSourceInfo.cs
index 27920bdf3..d6301b331 100644
--- a/MediaBrowser.Model/Dto/MediaSourceInfo.cs
+++ b/MediaBrowser.Model/Dto/MediaSourceInfo.cs
@@ -40,7 +40,6 @@ namespace MediaBrowser.Model.Dto
public string OpenToken { get; set; }
public bool RequiresClosing { get; set; }
public bool SupportsProbing { get; set; }
- public bool EnableMpDecimate { get; set; }
public string LiveStreamId { get; set; }
public int? BufferMs { get; set; }
diff --git a/MediaBrowser.Model/LiveTv/LiveTvOptions.cs b/MediaBrowser.Model/LiveTv/LiveTvOptions.cs
index caf1bb2a8..f177233f9 100644
--- a/MediaBrowser.Model/LiveTv/LiveTvOptions.cs
+++ b/MediaBrowser.Model/LiveTv/LiveTvOptions.cs
@@ -45,7 +45,6 @@ namespace MediaBrowser.Model.LiveTv
public bool ImportFavoritesOnly { get; set; }
public bool AllowHWTranscoding { get; set; }
public bool EnableStreamLooping { get; set; }
- public bool EnableMpDecimate { get; set; }
public bool EnableNewHdhrChannelIds { get; set; }
public string Source { get; set; }