aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations')
-rw-r--r--Emby.Server.Implementations/Data/SqliteItemRepository.cs43
-rw-r--r--Emby.Server.Implementations/Dto/DtoService.cs26
-rw-r--r--Emby.Server.Implementations/Library/LibraryManager.cs14
-rw-r--r--Emby.Server.Implementations/LiveTv/LiveTvManager.cs4
4 files changed, 49 insertions, 38 deletions
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
index 4a4a1a6bf..30fa68d95 100644
--- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs
+++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
@@ -3874,6 +3874,25 @@ namespace Emby.Server.Implementations.Data
whereClauses.Add(clause);
}
+ if (query.AlbumIds.Length > 0)
+ {
+ var clauses = new List<string>();
+ var index = 0;
+ foreach (var albumId in query.AlbumIds)
+ {
+ var paramName = "@AlbumIds" + index;
+
+ clauses.Add("Album in (select Name from typedbaseitems where guid=" + paramName + ")");
+ if (statement != null)
+ {
+ statement.TryBind(paramName, albumId.ToGuidParamValue());
+ }
+ index++;
+ }
+ var clause = "(" + string.Join(" OR ", clauses.ToArray()) + ")";
+ whereClauses.Add(clause);
+ }
+
if (query.ExcludeArtistIds.Length > 0)
{
var clauses = new List<string>();
@@ -4227,30 +4246,6 @@ namespace Emby.Server.Implementations.Data
{
whereClauses.Add("ProviderIds like '%tvdb=%'");
}
-
- if (query.AlbumNames.Length > 0)
- {
- var clause = "(";
-
- var index = 0;
- foreach (var name in query.AlbumNames)
- {
- if (index > 0)
- {
- clause += " OR ";
- }
- clause += "Album=@AlbumName" + index;
-
- if (statement != null)
- {
- statement.TryBind("@AlbumName" + index, name);
- }
- index++;
- }
-
- clause += ")";
- whereClauses.Add(clause);
- }
if (query.HasThemeSong.HasValue)
{
if (query.HasThemeSong.Value)
diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs
index c2cefe754..5b0bd8bbc 100644
--- a/Emby.Server.Implementations/Dto/DtoService.cs
+++ b/Emby.Server.Implementations/Dto/DtoService.cs
@@ -492,7 +492,10 @@ namespace Emby.Server.Implementations.Dto
}
}
- dto.PlayAccess = item.GetPlayAccess(user);
+ //if (!(item is LiveTvProgram))
+ {
+ dto.PlayAccess = item.GetPlayAccess(user);
+ }
if (fields.Contains(ItemFields.BasicSyncInfo) || fields.Contains(ItemFields.SyncInfo))
{
@@ -994,7 +997,12 @@ namespace Emby.Server.Implementations.Dto
}
dto.MediaType = item.MediaType;
- dto.LocationType = item.LocationType;
+
+ if (!(item is LiveTvProgram))
+ {
+ dto.LocationType = item.LocationType;
+ }
+
if (item.IsHD.HasValue && item.IsHD.Value)
{
dto.IsHD = item.IsHD;
@@ -1102,7 +1110,10 @@ namespace Emby.Server.Implementations.Dto
}
dto.Type = item.GetClientTypeName();
- dto.CommunityRating = item.CommunityRating;
+ if ((item.CommunityRating ?? 0) > 0)
+ {
+ dto.CommunityRating = item.CommunityRating;
+ }
if (fields.Contains(ItemFields.VoteCount))
{
@@ -1410,8 +1421,6 @@ namespace Emby.Server.Implementations.Dto
dto.AirDays = series.AirDays;
dto.AirTime = series.AirTime;
dto.SeriesStatus = series.Status;
-
- dto.AnimeSeriesIndex = series.AnimeSeriesIndex;
}
// Add SeasonInfo
@@ -1473,9 +1482,12 @@ namespace Emby.Server.Implementations.Dto
SetBookProperties(dto, book);
}
- if (item.ProductionLocations.Count > 0 || item is Movie)
+ if (fields.Contains(ItemFields.ProductionLocations))
{
- dto.ProductionLocations = item.ProductionLocations.ToArray();
+ if (item.ProductionLocations.Count > 0 || item is Movie)
+ {
+ dto.ProductionLocations = item.ProductionLocations.ToArray();
+ }
}
var photo = item as Photo;
diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs
index 879735ccb..56bffc233 100644
--- a/Emby.Server.Implementations/Library/LibraryManager.cs
+++ b/Emby.Server.Implementations/Library/LibraryManager.cs
@@ -409,17 +409,17 @@ namespace Emby.Server.Implementations.Library
if (options.DeleteFileLocation && locationType != LocationType.Remote && locationType != LocationType.Virtual)
{
- foreach (var path in item.GetDeletePaths().ToList())
+ foreach (var fileSystemInfo in item.GetDeletePaths().ToList())
{
- if (_fileSystem.DirectoryExists(path))
+ if (fileSystemInfo.IsDirectory)
{
- _logger.Debug("Deleting path {0}", path);
- _fileSystem.DeleteDirectory(path, true);
+ _logger.Debug("Deleting path {0}", fileSystemInfo.FullName);
+ _fileSystem.DeleteDirectory(fileSystemInfo.FullName, true);
}
- else if (_fileSystem.FileExists(path))
+ else
{
- _logger.Debug("Deleting path {0}", path);
- _fileSystem.DeleteFile(path);
+ _logger.Debug("Deleting path {0}", fileSystemInfo.FullName);
+ _fileSystem.DeleteFile(fileSystemInfo.FullName);
}
}
diff --git a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs
index b139c68f4..d5ea0d493 100644
--- a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs
+++ b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs
@@ -607,6 +607,10 @@ namespace Emby.Server.Implementations.LiveTv
item.Audio = info.Audio;
item.ChannelId = channel.Id.ToString("N");
item.CommunityRating = item.CommunityRating ?? info.CommunityRating;
+ if ((item.CommunityRating ?? 0).Equals(0))
+ {
+ item.CommunityRating = null;
+ }
item.EpisodeTitle = info.EpisodeTitle;
item.ExternalId = info.Id;