consolidate fields
This commit is contained in:
parent
773c00861e
commit
900714c866
|
@ -113,7 +113,7 @@ namespace Emby.Dlna.PlayTo
|
||||||
|
|
||||||
private int GetInactiveTimerIntervalMs()
|
private int GetInactiveTimerIntervalMs()
|
||||||
{
|
{
|
||||||
return 30000;
|
return Timeout.Infinite;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Start()
|
public void Start()
|
||||||
|
@ -161,18 +161,15 @@ namespace Emby.Dlna.PlayTo
|
||||||
if (_disposed)
|
if (_disposed)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!_timerActive)
|
lock (_timerLock)
|
||||||
{
|
{
|
||||||
lock (_timerLock)
|
if (!_timerActive)
|
||||||
{
|
{
|
||||||
if (!_timerActive)
|
_logger.Debug("RestartTimer");
|
||||||
{
|
_timer.Change(10, GetPlaybackTimerIntervalMs());
|
||||||
_logger.Debug("RestartTimer");
|
|
||||||
_timer.Change(10, GetPlaybackTimerIntervalMs());
|
|
||||||
}
|
|
||||||
|
|
||||||
_timerActive = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_timerActive = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,23 +181,20 @@ namespace Emby.Dlna.PlayTo
|
||||||
if (_disposed)
|
if (_disposed)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_timerActive)
|
lock (_timerLock)
|
||||||
{
|
{
|
||||||
lock (_timerLock)
|
if (_timerActive)
|
||||||
{
|
{
|
||||||
if (_timerActive)
|
_logger.Debug("RestartTimerInactive");
|
||||||
|
var interval = GetInactiveTimerIntervalMs();
|
||||||
|
|
||||||
|
if (_timer != null)
|
||||||
{
|
{
|
||||||
_logger.Debug("RestartTimerInactive");
|
_timer.Change(interval, interval);
|
||||||
var interval = GetInactiveTimerIntervalMs();
|
|
||||||
|
|
||||||
if (_timer != null)
|
|
||||||
{
|
|
||||||
_timer.Change(interval, interval);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_timerActive = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_timerActive = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -493,6 +487,10 @@ namespace Emby.Dlna.PlayTo
|
||||||
RestartTimer();
|
RestartTimer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RestartTimerInactive();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (HttpException ex)
|
catch (HttpException ex)
|
||||||
{
|
{
|
||||||
|
|
|
@ -639,7 +639,6 @@ namespace Emby.Server.Implementations.Dto
|
||||||
|
|
||||||
private void SetGameProperties(BaseItemDto dto, Game item)
|
private void SetGameProperties(BaseItemDto dto, Game item)
|
||||||
{
|
{
|
||||||
dto.Players = item.PlayersSupported;
|
|
||||||
dto.GameSystem = item.GameSystem;
|
dto.GameSystem = item.GameSystem;
|
||||||
dto.MultiPartGameFiles = item.MultiPartGameFiles;
|
dto.MultiPartGameFiles = item.MultiPartGameFiles;
|
||||||
}
|
}
|
||||||
|
@ -1310,15 +1309,6 @@ namespace Emby.Server.Implementations.Dto
|
||||||
|
|
||||||
Series episodeSeries = null;
|
Series episodeSeries = null;
|
||||||
|
|
||||||
if (fields.Contains(ItemFields.SeriesGenres))
|
|
||||||
{
|
|
||||||
episodeSeries = episodeSeries ?? episode.Series;
|
|
||||||
if (episodeSeries != null)
|
|
||||||
{
|
|
||||||
dto.SeriesGenres = episodeSeries.Genres.ToList();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//if (fields.Contains(ItemFields.SeriesPrimaryImage))
|
//if (fields.Contains(ItemFields.SeriesPrimaryImage))
|
||||||
{
|
{
|
||||||
episodeSeries = episodeSeries ?? episode.Series;
|
episodeSeries = episodeSeries ?? episode.Series;
|
||||||
|
@ -1334,27 +1324,6 @@ namespace Emby.Server.Implementations.Dto
|
||||||
if (episodeSeries != null)
|
if (episodeSeries != null)
|
||||||
{
|
{
|
||||||
dto.SeriesStudio = episodeSeries.Studios.FirstOrDefault();
|
dto.SeriesStudio = episodeSeries.Studios.FirstOrDefault();
|
||||||
if (!string.IsNullOrWhiteSpace(dto.SeriesStudio))
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var studio = _libraryManager.GetStudio(dto.SeriesStudio);
|
|
||||||
|
|
||||||
if (studio != null)
|
|
||||||
{
|
|
||||||
dto.SeriesStudioInfo = new StudioDto
|
|
||||||
{
|
|
||||||
Name = dto.SeriesStudio,
|
|
||||||
Id = studio.Id.ToString("N"),
|
|
||||||
PrimaryImageTag = GetImageCacheTag(studio, ImageType.Primary)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1363,7 +1332,7 @@ namespace Emby.Server.Implementations.Dto
|
||||||
var series = item as Series;
|
var series = item as Series;
|
||||||
if (series != null)
|
if (series != null)
|
||||||
{
|
{
|
||||||
dto.AirDays = series.AirDays;
|
dto.AirDays = series.AirDays.ToArray();
|
||||||
dto.AirTime = series.AirTime;
|
dto.AirTime = series.AirTime;
|
||||||
dto.Status = series.Status.HasValue ? series.Status.Value.ToString() : null;
|
dto.Status = series.Status.HasValue ? series.Status.Value.ToString() : null;
|
||||||
}
|
}
|
||||||
|
@ -1498,7 +1467,9 @@ namespace Emby.Server.Implementations.Dto
|
||||||
BaseItem parent = null;
|
BaseItem parent = null;
|
||||||
var isFirst = true;
|
var isFirst = true;
|
||||||
|
|
||||||
while (((!dto.HasLogo && logoLimit > 0) || (!dto.HasArtImage && artLimit > 0) || (!dto.HasThumb && thumbLimit > 0) || parent is Series) &&
|
var imageTags = dto.ImageTags;
|
||||||
|
|
||||||
|
while (((!(imageTags != null && imageTags.ContainsKey(ImageType.Logo)) && logoLimit > 0) || (!(imageTags != null && imageTags.ContainsKey(ImageType.Art)) && artLimit > 0) || (!(imageTags != null && imageTags.ContainsKey(ImageType.Thumb)) && thumbLimit > 0) || parent is Series) &&
|
||||||
(parent = parent ?? (isFirst ? GetImageDisplayParent(item, item) ?? owner : parent)) != null)
|
(parent = parent ?? (isFirst ? GetImageDisplayParent(item, item) ?? owner : parent)) != null)
|
||||||
{
|
{
|
||||||
if (parent == null)
|
if (parent == null)
|
||||||
|
@ -1508,7 +1479,7 @@ namespace Emby.Server.Implementations.Dto
|
||||||
|
|
||||||
var allImages = parent.ImageInfos;
|
var allImages = parent.ImageInfos;
|
||||||
|
|
||||||
if (logoLimit > 0 && !dto.HasLogo && dto.ParentLogoItemId == null)
|
if (logoLimit > 0 && !(imageTags != null && imageTags.ContainsKey(ImageType.Logo)) && dto.ParentLogoItemId == null)
|
||||||
{
|
{
|
||||||
var image = allImages.FirstOrDefault(i => i.Type == ImageType.Logo);
|
var image = allImages.FirstOrDefault(i => i.Type == ImageType.Logo);
|
||||||
|
|
||||||
|
@ -1518,7 +1489,7 @@ namespace Emby.Server.Implementations.Dto
|
||||||
dto.ParentLogoImageTag = GetImageCacheTag(parent, image);
|
dto.ParentLogoImageTag = GetImageCacheTag(parent, image);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (artLimit > 0 && !dto.HasArtImage && dto.ParentArtItemId == null)
|
if (artLimit > 0 && !(imageTags != null && imageTags.ContainsKey(ImageType.Art)) && dto.ParentArtItemId == null)
|
||||||
{
|
{
|
||||||
var image = allImages.FirstOrDefault(i => i.Type == ImageType.Art);
|
var image = allImages.FirstOrDefault(i => i.Type == ImageType.Art);
|
||||||
|
|
||||||
|
@ -1528,7 +1499,7 @@ namespace Emby.Server.Implementations.Dto
|
||||||
dto.ParentArtImageTag = GetImageCacheTag(parent, image);
|
dto.ParentArtImageTag = GetImageCacheTag(parent, image);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (thumbLimit > 0 && !dto.HasThumb && (dto.ParentThumbItemId == null || parent is Series) && !(parent is ICollectionFolder) && !(parent is UserView))
|
if (thumbLimit > 0 && !(imageTags != null && imageTags.ContainsKey(ImageType.Thumb)) && (dto.ParentThumbItemId == null || parent is Series) && !(parent is ICollectionFolder) && !(parent is UserView))
|
||||||
{
|
{
|
||||||
var image = allImages.FirstOrDefault(i => i.Type == ImageType.Thumb);
|
var image = allImages.FirstOrDefault(i => i.Type == ImageType.Thumb);
|
||||||
|
|
||||||
|
@ -1538,7 +1509,7 @@ namespace Emby.Server.Implementations.Dto
|
||||||
dto.ParentThumbImageTag = GetImageCacheTag(parent, image);
|
dto.ParentThumbImageTag = GetImageCacheTag(parent, image);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (backdropLimit > 0 && !dto.HasBackdrop)
|
if (backdropLimit > 0 && !((dto.BackdropImageTags != null && dto.BackdropImageTags.Length > 0) || (dto.ParentBackdropImageTags != null && dto.ParentBackdropImageTags.Length > 0)))
|
||||||
{
|
{
|
||||||
var images = allImages.Where(i => i.Type == ImageType.Backdrop).Take(backdropLimit).ToList();
|
var images = allImages.Where(i => i.Type == ImageType.Backdrop).Take(backdropLimit).ToList();
|
||||||
|
|
||||||
|
|
|
@ -1686,7 +1686,6 @@ namespace Emby.Server.Implementations.Session
|
||||||
dtoOptions.Fields.Remove(ItemFields.RecursiveItemCount);
|
dtoOptions.Fields.Remove(ItemFields.RecursiveItemCount);
|
||||||
dtoOptions.Fields.Remove(ItemFields.RemoteTrailers);
|
dtoOptions.Fields.Remove(ItemFields.RemoteTrailers);
|
||||||
dtoOptions.Fields.Remove(ItemFields.SeasonUserData);
|
dtoOptions.Fields.Remove(ItemFields.SeasonUserData);
|
||||||
dtoOptions.Fields.Remove(ItemFields.SeriesGenres);
|
|
||||||
dtoOptions.Fields.Remove(ItemFields.Settings);
|
dtoOptions.Fields.Remove(ItemFields.Settings);
|
||||||
dtoOptions.Fields.Remove(ItemFields.SortName);
|
dtoOptions.Fields.Remove(ItemFields.SortName);
|
||||||
dtoOptions.Fields.Remove(ItemFields.Tags);
|
dtoOptions.Fields.Remove(ItemFields.Tags);
|
||||||
|
|
|
@ -332,13 +332,6 @@ namespace MediaBrowser.Api
|
||||||
video.Video3DFormat = request.Video3DFormat;
|
video.Video3DFormat = request.Video3DFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
var game = item as Game;
|
|
||||||
|
|
||||||
if (game != null)
|
|
||||||
{
|
|
||||||
game.PlayersSupported = request.Players;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (request.AlbumArtists != null)
|
if (request.AlbumArtists != null)
|
||||||
{
|
{
|
||||||
var hasAlbumArtists = item as IHasAlbumArtist;
|
var hasAlbumArtists = item as IHasAlbumArtist;
|
||||||
|
|
|
@ -349,7 +349,9 @@ namespace MediaBrowser.Model.Configuration
|
||||||
Limit = 1,
|
Limit = 1,
|
||||||
Type = ImageType.Logo
|
Type = ImageType.Logo
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
|
DisabledImageFetchers = new [] {"FanArt"}
|
||||||
},
|
},
|
||||||
|
|
||||||
new MetadataOptions(1, 1280)
|
new MetadataOptions(1, 1280)
|
||||||
|
@ -539,7 +541,8 @@ namespace MediaBrowser.Model.Configuration
|
||||||
Type = ImageType.Thumb
|
Type = ImageType.Thumb
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
DisabledMetadataFetchers = new []{ "TheMovieDb" }
|
DisabledMetadataFetchers = new []{ "TheMovieDb" },
|
||||||
|
DisabledImageFetchers = new [] { "FanArt" }
|
||||||
},
|
},
|
||||||
|
|
||||||
new MetadataOptions(0, 1280)
|
new MetadataOptions(0, 1280)
|
||||||
|
|
|
@ -209,12 +209,6 @@ namespace MediaBrowser.Model.Dto
|
||||||
/// <value>The genres.</value>
|
/// <value>The genres.</value>
|
||||||
public List<string> Genres { get; set; }
|
public List<string> Genres { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the series genres.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The series genres.</value>
|
|
||||||
public List<string> SeriesGenres { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the community rating.
|
/// Gets or sets the community rating.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -257,12 +251,6 @@ namespace MediaBrowser.Model.Dto
|
||||||
/// <value>The production year.</value>
|
/// <value>The production year.</value>
|
||||||
public int? ProductionYear { get; set; }
|
public int? ProductionYear { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the players supported by a game.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The players.</value>
|
|
||||||
public int? Players { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets a value indicating whether this instance is place holder.
|
/// Gets or sets a value indicating whether this instance is place holder.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -432,7 +420,7 @@ namespace MediaBrowser.Model.Dto
|
||||||
/// Gets or sets the air days.
|
/// Gets or sets the air days.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The air days.</value>
|
/// <value>The air days.</value>
|
||||||
public List<DayOfWeek> AirDays { get; set; }
|
public DayOfWeek[] AirDays { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the tags.
|
/// Gets or sets the tags.
|
||||||
|
@ -598,8 +586,6 @@ namespace MediaBrowser.Model.Dto
|
||||||
/// <value>The series studio.</value>
|
/// <value>The series studio.</value>
|
||||||
public string SeriesStudio { get; set; }
|
public string SeriesStudio { get; set; }
|
||||||
|
|
||||||
public StudioDto SeriesStudioInfo { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the parent thumb item id.
|
/// Gets or sets the parent thumb item id.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -741,46 +727,6 @@ namespace MediaBrowser.Model.Dto
|
||||||
/// <value>The series timer identifier.</value>
|
/// <value>The series timer identifier.</value>
|
||||||
public string SeriesTimerId { get; set; }
|
public string SeriesTimerId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets a value indicating whether this instance has art.
|
|
||||||
/// </summary>
|
|
||||||
/// <value><c>true</c> if this instance has art; otherwise, <c>false</c>.</value>
|
|
||||||
[IgnoreDataMember]
|
|
||||||
public bool HasArtImage
|
|
||||||
{
|
|
||||||
get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Art); }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets a value indicating whether this instance has logo.
|
|
||||||
/// </summary>
|
|
||||||
/// <value><c>true</c> if this instance has logo; otherwise, <c>false</c>.</value>
|
|
||||||
[IgnoreDataMember]
|
|
||||||
public bool HasLogo
|
|
||||||
{
|
|
||||||
get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Logo); }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets a value indicating whether this instance has thumb.
|
|
||||||
/// </summary>
|
|
||||||
/// <value><c>true</c> if this instance has thumb; otherwise, <c>false</c>.</value>
|
|
||||||
[IgnoreDataMember]
|
|
||||||
public bool HasThumb
|
|
||||||
{
|
|
||||||
get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Thumb); }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets a value indicating whether this instance has thumb.
|
|
||||||
/// </summary>
|
|
||||||
/// <value><c>true</c> if this instance has thumb; otherwise, <c>false</c>.</value>
|
|
||||||
[IgnoreDataMember]
|
|
||||||
public bool HasBackdrop
|
|
||||||
{
|
|
||||||
get { return (BackdropImageTags != null && BackdropImageTags.Length > 0) || (ParentBackdropImageTags != null && ParentBackdropImageTags.Length > 0); }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the program identifier.
|
/// Gets or sets the program identifier.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
using System.Diagnostics;
|
|
||||||
|
|
||||||
namespace MediaBrowser.Model.Dto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Class StudioDto
|
|
||||||
/// </summary>
|
|
||||||
[DebuggerDisplay("Name = {Name}")]
|
|
||||||
public class StudioDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the name.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The name.</value>
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the identifier.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The identifier.</value>
|
|
||||||
public string Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the primary image tag.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The primary image tag.</value>
|
|
||||||
public string PrimaryImageTag { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -284,7 +284,6 @@
|
||||||
<Compile Include="Providers\ExternalUrl.cs" />
|
<Compile Include="Providers\ExternalUrl.cs" />
|
||||||
<Compile Include="Providers\ImageProviderInfo.cs" />
|
<Compile Include="Providers\ImageProviderInfo.cs" />
|
||||||
<Compile Include="Providers\RemoteImageInfo.cs" />
|
<Compile Include="Providers\RemoteImageInfo.cs" />
|
||||||
<Compile Include="Dto\StudioDto.cs" />
|
|
||||||
<Compile Include="Entities\CollectionType.cs" />
|
<Compile Include="Entities\CollectionType.cs" />
|
||||||
<Compile Include="Entities\ItemReview.cs" />
|
<Compile Include="Entities\ItemReview.cs" />
|
||||||
<Compile Include="Entities\MediaUrl.cs" />
|
<Compile Include="Entities\MediaUrl.cs" />
|
||||||
|
|
|
@ -153,11 +153,6 @@
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ScreenshotImageTags,
|
ScreenshotImageTags,
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The series genres
|
|
||||||
/// </summary>
|
|
||||||
SeriesGenres,
|
|
||||||
|
|
||||||
SeriesPrimaryImage,
|
SeriesPrimaryImage,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user