mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-15 18:08:53 -07:00
made xml saver methods a little cleaner
This commit is contained in:
parent
1e49857765
commit
ac7d6256f4
@ -28,9 +28,11 @@ namespace MediaBrowser.Providers.Savers
|
||||
/// <returns><c>true</c> if [is enabled for] [the specified item]; otherwise, <c>false</c>.</returns>
|
||||
public bool IsEnabledFor(BaseItem item, ItemUpdateType updateType)
|
||||
{
|
||||
var wasMetadataEdited = (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit;
|
||||
var wasMetadataDownloaded = (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload;
|
||||
|
||||
// If new metadata has been downloaded and save local is on, OR metadata was manually edited, proceed
|
||||
if ((_config.Configuration.SaveLocalMeta && (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload)
|
||||
|| (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit)
|
||||
if ((_config.Configuration.SaveLocalMeta && (wasMetadataEdited || wasMetadataDownloaded)) || wasMetadataEdited)
|
||||
{
|
||||
return item is MusicAlbum;
|
||||
}
|
||||
|
@ -26,9 +26,11 @@ namespace MediaBrowser.Providers.Savers
|
||||
/// <returns><c>true</c> if [is enabled for] [the specified item]; otherwise, <c>false</c>.</returns>
|
||||
public bool IsEnabledFor(BaseItem item, ItemUpdateType updateType)
|
||||
{
|
||||
var wasMetadataEdited = (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit;
|
||||
var wasMetadataDownloaded = (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload;
|
||||
|
||||
// If new metadata has been downloaded and save local is on, OR metadata was manually edited, proceed
|
||||
if ((_config.Configuration.SaveLocalMeta && (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload)
|
||||
|| (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit)
|
||||
if ((_config.Configuration.SaveLocalMeta && (wasMetadataEdited || wasMetadataDownloaded)) || wasMetadataEdited)
|
||||
{
|
||||
return item is BoxSet;
|
||||
}
|
||||
|
@ -24,9 +24,11 @@ namespace MediaBrowser.Providers.Savers
|
||||
/// <returns><c>true</c> if [is enabled for] [the specified item]; otherwise, <c>false</c>.</returns>
|
||||
public bool IsEnabledFor(BaseItem item, ItemUpdateType updateType)
|
||||
{
|
||||
var wasMetadataEdited = (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit;
|
||||
var wasMetadataDownloaded = (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload;
|
||||
|
||||
// If new metadata has been downloaded and save local is on, OR metadata was manually edited, proceed
|
||||
if ((_config.Configuration.SaveLocalMeta && (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload)
|
||||
|| (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit)
|
||||
if ((_config.Configuration.SaveLocalMeta && (wasMetadataEdited || wasMetadataDownloaded)) || wasMetadataEdited)
|
||||
{
|
||||
return item is Episode;
|
||||
}
|
||||
|
@ -33,9 +33,11 @@ namespace MediaBrowser.Providers.Savers
|
||||
return false;
|
||||
}
|
||||
|
||||
var wasMetadataEdited = (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit;
|
||||
var wasMetadataDownloaded = (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload;
|
||||
|
||||
// If new metadata has been downloaded and save local is on, OR metadata was manually edited, proceed
|
||||
if ((_config.Configuration.SaveLocalMeta && (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload)
|
||||
|| (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit)
|
||||
if ((_config.Configuration.SaveLocalMeta && wasMetadataDownloaded) || wasMetadataEdited)
|
||||
{
|
||||
if (!(item is Series) && !(item is BoxSet) && !(item is MusicArtist) && !(item is MusicAlbum) &&
|
||||
!(item is Season))
|
||||
@ -45,8 +47,7 @@ namespace MediaBrowser.Providers.Savers
|
||||
}
|
||||
|
||||
// If new metadata has been downloaded or metadata was manually edited, proceed
|
||||
if ((updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload
|
||||
|| (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit)
|
||||
if (wasMetadataDownloaded || wasMetadataEdited)
|
||||
{
|
||||
if (item is AggregateFolder || item is UserRootFolder || item is CollectionFolder)
|
||||
{
|
||||
|
@ -31,9 +31,11 @@ namespace MediaBrowser.Providers.Savers
|
||||
/// <returns><c>true</c> if [is enabled for] [the specified item]; otherwise, <c>false</c>.</returns>
|
||||
public bool IsEnabledFor(BaseItem item, ItemUpdateType updateType)
|
||||
{
|
||||
var wasMetadataEdited = (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit;
|
||||
var wasMetadataDownloaded = (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload;
|
||||
|
||||
// If new metadata has been downloaded and save local is on, OR metadata was manually edited, proceed
|
||||
if ((_config.Configuration.SaveLocalMeta && (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload)
|
||||
|| (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit)
|
||||
if ((_config.Configuration.SaveLocalMeta && (wasMetadataEdited || wasMetadataDownloaded)) || wasMetadataEdited)
|
||||
{
|
||||
var trailer = item as Trailer;
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Providers.Movies;
|
||||
using System;
|
||||
using System.IO;
|
||||
@ -22,9 +21,11 @@ namespace MediaBrowser.Providers.Savers
|
||||
/// <returns><c>true</c> if [is enabled for] [the specified item]; otherwise, <c>false</c>.</returns>
|
||||
public bool IsEnabledFor(BaseItem item, ItemUpdateType updateType)
|
||||
{
|
||||
var wasMetadataEdited = (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit;
|
||||
var wasMetadataDownloaded = (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload;
|
||||
|
||||
// If new metadata has been downloaded or metadata was manually edited, proceed
|
||||
if ((updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload
|
||||
|| (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit)
|
||||
if ((wasMetadataEdited || wasMetadataDownloaded))
|
||||
{
|
||||
return item is Person;
|
||||
}
|
||||
|
@ -2,7 +2,6 @@
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
@ -26,9 +25,11 @@ namespace MediaBrowser.Providers.Savers
|
||||
/// <returns><c>true</c> if [is enabled for] [the specified item]; otherwise, <c>false</c>.</returns>
|
||||
public bool IsEnabledFor(BaseItem item, ItemUpdateType updateType)
|
||||
{
|
||||
var wasMetadataEdited = (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit;
|
||||
var wasMetadataDownloaded = (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload;
|
||||
|
||||
// If new metadata has been downloaded and save local is on, OR metadata was manually edited, proceed
|
||||
if ((_config.Configuration.SaveLocalMeta && (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload)
|
||||
|| (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit)
|
||||
if ((_config.Configuration.SaveLocalMeta && (wasMetadataEdited || wasMetadataDownloaded)) || wasMetadataEdited)
|
||||
{
|
||||
return item is Season;
|
||||
}
|
||||
|
@ -29,9 +29,11 @@ namespace MediaBrowser.Providers.Savers
|
||||
/// <returns><c>true</c> if [is enabled for] [the specified item]; otherwise, <c>false</c>.</returns>
|
||||
public bool IsEnabledFor(BaseItem item, ItemUpdateType updateType)
|
||||
{
|
||||
var wasMetadataEdited = (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit;
|
||||
var wasMetadataDownloaded = (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload;
|
||||
|
||||
// If new metadata has been downloaded and save local is on, OR metadata was manually edited, proceed
|
||||
if ((_config.Configuration.SaveLocalMeta && (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload)
|
||||
|| (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit)
|
||||
if ((_config.Configuration.SaveLocalMeta && (wasMetadataEdited || wasMetadataDownloaded)) || wasMetadataEdited)
|
||||
{
|
||||
return item is Series;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user