aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Api')
-rw-r--r--MediaBrowser.Api/LiveTv/LiveTvService.cs4
-rw-r--r--MediaBrowser.Api/Playback/BaseStreamingService.cs4
-rw-r--r--MediaBrowser.Api/Reports/ReportsService.cs16
-rw-r--r--MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs17
-rw-r--r--MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs5
-rw-r--r--MediaBrowser.Api/UserLibrary/ItemsService.cs39
6 files changed, 54 insertions, 31 deletions
diff --git a/MediaBrowser.Api/LiveTv/LiveTvService.cs b/MediaBrowser.Api/LiveTv/LiveTvService.cs
index c829ad2ab..85a66080d 100644
--- a/MediaBrowser.Api/LiveTv/LiveTvService.cs
+++ b/MediaBrowser.Api/LiveTv/LiveTvService.cs
@@ -202,6 +202,7 @@ namespace MediaBrowser.Api.LiveTv
public bool? IsKids { get; set; }
public bool? IsSports { get; set; }
public bool? IsNews { get; set; }
+ public bool? IsLibraryItem { get; set; }
public GetRecordings()
{
@@ -1057,7 +1058,8 @@ namespace MediaBrowser.Api.LiveTv
IsNews = request.IsNews,
IsSeries = request.IsSeries,
IsKids = request.IsKids,
- IsSports = request.IsSports
+ IsSports = request.IsSports,
+ IsLibraryItem = request.IsLibraryItem
}, options, CancellationToken.None).ConfigureAwait(false);
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs
index 3718edba4..6545d995c 100644
--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs
+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs
@@ -818,7 +818,7 @@ namespace MediaBrowser.Api.Playback
if (state.VideoStream != null && state.VideoStream.Width.HasValue && state.VideoStream.Height.HasValue)
{
- videoSizeParam = string.Format(",scale={0}:{1}", state.VideoStream.Width.Value.ToString(UsCulture), state.VideoStream.Height.Value.ToString(UsCulture));
+ videoSizeParam = string.Format("scale={0}:{1}", state.VideoStream.Width.Value.ToString(UsCulture), state.VideoStream.Height.Value.ToString(UsCulture));
}
var mapPrefix = state.SubtitleStream.IsExternal ?
@@ -829,7 +829,7 @@ namespace MediaBrowser.Api.Playback
? 0
: state.SubtitleStream.Index;
- return string.Format(" -filter_complex \"[{0}:{1}]format=yuva444p{4},lut=u=128:v=128:y=gammaval(.3)[sub] ; [0:{2}] [sub] overlay{3}\"",
+ return string.Format(" -filter_complex \"[{0}:{1}]{4}[sub] ; [0:{2}] [sub] overlay{3}\"",
mapPrefix.ToString(UsCulture),
subtitleStreamIndex.ToString(UsCulture),
state.VideoStream.Index.ToString(UsCulture),
diff --git a/MediaBrowser.Api/Reports/ReportsService.cs b/MediaBrowser.Api/Reports/ReportsService.cs
index 5c4d21d66..efbfa1bdf 100644
--- a/MediaBrowser.Api/Reports/ReportsService.cs
+++ b/MediaBrowser.Api/Reports/ReportsService.cs
@@ -209,7 +209,6 @@ namespace MediaBrowser.Api.Reports
OfficialRatings = request.GetOfficialRatings(),
Genres = request.GetGenres(),
GenreIds = request.GetGenreIds(),
- Studios = request.GetStudios(),
StudioIds = request.GetStudioIds(),
Person = request.Person,
PersonIds = request.GetPersonIds(),
@@ -314,21 +313,6 @@ namespace MediaBrowser.Api.Reports
query.MaxParentalRating = _localization.GetRatingLevel(request.MaxOfficialRating);
}
- // Artists
- if (!string.IsNullOrEmpty(request.ArtistIds))
- {
- var artistIds = request.ArtistIds.Split(new[] { '|', ',' });
-
- var artistItems = artistIds.Select(_libraryManager.GetItemById).Where(i => i != null).ToList();
- query.ArtistNames = artistItems.Select(i => i.Name).ToArray();
- }
-
- // Artists
- if (!string.IsNullOrEmpty(request.Artists))
- {
- query.ArtistNames = request.Artists.Split('|');
- }
-
// Albums
if (!string.IsNullOrEmpty(request.Albums))
{
diff --git a/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs b/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs
index ff285b605..5b939244e 100644
--- a/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs
+++ b/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs
@@ -124,7 +124,6 @@ namespace MediaBrowser.Api.UserLibrary
OfficialRatings = request.GetOfficialRatings(),
Genres = request.GetGenres(),
GenreIds = request.GetGenreIds(),
- Studios = request.GetStudios(),
StudioIds = request.GetStudioIds(),
Person = request.Person,
PersonIds = request.GetPersonIds(),
@@ -145,6 +144,22 @@ namespace MediaBrowser.Api.UserLibrary
}
}
+ // Studios
+ if (!string.IsNullOrEmpty(request.Studios))
+ {
+ query.StudioIds = request.Studios.Split('|').Select(i =>
+ {
+ try
+ {
+ return LibraryManager.GetStudio(i);
+ }
+ catch
+ {
+ return null;
+ }
+ }).Where(i => i != null).Select(i => i.Id.ToString("N")).ToArray();
+ }
+
foreach (var filter in request.GetFilters())
{
switch (filter)
diff --git a/MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs b/MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs
index f106adde5..0594691a2 100644
--- a/MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs
+++ b/MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs
@@ -394,6 +394,11 @@ namespace MediaBrowser.Api.UserLibrary
return (Studios ?? string.Empty).Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
}
+ public string[] GetArtistIds()
+ {
+ return (ArtistIds ?? string.Empty).Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
+ }
+
public string[] GetStudioIds()
{
return (StudioIds ?? string.Empty).Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs
index a07128f74..049a7b1c6 100644
--- a/MediaBrowser.Api/UserLibrary/ItemsService.cs
+++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs
@@ -230,8 +230,8 @@ namespace MediaBrowser.Api.UserLibrary
Tags = request.GetTags(),
OfficialRatings = request.GetOfficialRatings(),
Genres = request.GetGenres(),
+ ArtistIds = request.GetArtistIds(),
GenreIds = request.GetGenreIds(),
- Studios = request.GetStudios(),
StudioIds = request.GetStudioIds(),
Person = request.Person,
PersonIds = request.GetPersonIds(),
@@ -339,18 +339,19 @@ namespace MediaBrowser.Api.UserLibrary
}
// Artists
- if (!string.IsNullOrEmpty(request.ArtistIds))
- {
- var artistIds = request.ArtistIds.Split(new[] { '|', ',' });
-
- var artistItems = artistIds.Select(_libraryManager.GetItemById).Where(i => i != null).ToList();
- query.ArtistNames = artistItems.Select(i => i.Name).ToArray();
- }
-
- // Artists
if (!string.IsNullOrEmpty(request.Artists))
{
- query.ArtistNames = request.Artists.Split('|');
+ query.ArtistIds = request.Artists.Split('|').Select(i =>
+ {
+ try
+ {
+ return _libraryManager.GetArtist(i);
+ }
+ catch
+ {
+ return null;
+ }
+ }).Where(i => i != null).Select(i => i.Id.ToString("N")).ToArray();
}
// ExcludeArtistIds
@@ -365,6 +366,22 @@ namespace MediaBrowser.Api.UserLibrary
query.AlbumNames = request.Albums.Split('|');
}
+ // Studios
+ if (!string.IsNullOrEmpty(request.Studios))
+ {
+ query.StudioIds = request.Studios.Split('|').Select(i =>
+ {
+ try
+ {
+ return _libraryManager.GetStudio(i);
+ }
+ catch
+ {
+ return null;
+ }
+ }).Where(i => i != null).Select(i => i.Id.ToString("N")).ToArray();
+ }
+
return query;
}
}