remove obsolete markings

pull/702/head
Luke Pulverenti 10 years ago
parent 3d47b495a9
commit 62d98551ed

@ -199,7 +199,6 @@ namespace MediaBrowser.Model.Configuration
public string UICulture { get; set; }
[Obsolete]
public DlnaOptions DlnaOptions { get; set; }
public double DownMixAudioBoost { get; set; }
@ -213,10 +212,8 @@ namespace MediaBrowser.Model.Configuration
public ChannelOptions ChannelOptions { get; set; }
[Obsolete]
public ChapterOptions ChapterOptions { get; set; }
[Obsolete]
public bool DefaultMetadataSettingsApplied { get; set; }
/// <summary>

@ -289,7 +289,7 @@ namespace MediaBrowser.ServerApplication
DeleteDeprecatedModules();
MigrateModularConfigurations();
ApplyDefaultXbmcSettings();
ApplyDefaultMetadataSettings();
}
private void MigrateModularConfigurations()
@ -316,7 +316,7 @@ namespace MediaBrowser.ServerApplication
}
}
private void ApplyDefaultXbmcSettings()
private void ApplyDefaultMetadataSettings()
{
if (!ServerConfigurationManager.Configuration.DefaultMetadataSettingsApplied)
{

@ -36,22 +36,39 @@ namespace MediaBrowser.XbmcMetadata
void _libraryManager_ItemUpdated(object sender, ItemChangeEventArgs e)
{
if (e.UpdateReason == ItemUpdateType.ImageUpdate && e.Item is Person)
// TODO: Need a more accurate check here to see if xbmc metadata saving is enabled.
// This is probably good enough, but no guarantee
var userId = _config.GetNfoConfiguration().UserId;
if (string.IsNullOrWhiteSpace(userId))
{
var person = e.Item.Name;
return;
}
var items = _libraryManager.RootFolder
.GetRecursiveChildren(i => !i.IsFolder && i.People.Any(p => string.Equals(p.Name, person, StringComparison.OrdinalIgnoreCase)));
if (e.UpdateReason == ItemUpdateType.ImageUpdate)
{
var person = e.Item as Person;
foreach (var item in items)
if (person != null)
{
SaveMetadataForItem(item, ItemUpdateType.MetadataEdit);
var items = _libraryManager.RootFolder.RecursiveChildren;
items = person.GetTaggedItems(items).ToList();
foreach (var item in items)
{
SaveMetadataForItem(item, ItemUpdateType.MetadataEdit);
}
}
}
}
void _userDataManager_UserDataSaved(object sender, UserDataSaveEventArgs e)
{
var userId = _config.GetNfoConfiguration().UserId;
if (string.IsNullOrWhiteSpace(userId))
{
return;
}
if (e.SaveReason == UserDataSaveReason.PlaybackFinished || e.SaveReason == UserDataSaveReason.TogglePlayed)
{
var item = e.Item as BaseItem;
@ -73,12 +90,6 @@ namespace MediaBrowser.XbmcMetadata
private async void SaveMetadataForItem(BaseItem item, ItemUpdateType updateReason)
{
var userId = _config.GetNfoConfiguration().UserId;
if (string.IsNullOrWhiteSpace(userId))
{
return;
}
var locationType = item.LocationType;
if (locationType == LocationType.Remote ||
locationType == LocationType.Virtual)

@ -95,20 +95,12 @@ namespace MediaBrowser.XbmcMetadata.Savers
public bool IsEnabledFor(IHasMetadata item, ItemUpdateType updateType)
{
var locationType = item.LocationType;
if (locationType == LocationType.Remote || locationType == LocationType.Virtual)
if (!item.SupportsLocalMetadata)
{
return false;
}
// If new metadata has been downloaded or metadata was manually edited, proceed
if ((updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload
|| (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit)
{
return item is MusicAlbum;
}
return false;
return item is MusicAlbum && updateType >= ItemUpdateType.MetadataDownload;
}
private static readonly CultureInfo UsCulture = new CultureInfo("en-US");

@ -85,20 +85,12 @@ namespace MediaBrowser.XbmcMetadata.Savers
public bool IsEnabledFor(IHasMetadata item, ItemUpdateType updateType)
{
var locationType = item.LocationType;
if (locationType == LocationType.Remote || locationType == LocationType.Virtual)
if (!item.SupportsLocalMetadata)
{
return false;
}
// If new metadata has been downloaded or metadata was manually edited, proceed
if ((updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload
|| (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit)
{
return item is MusicArtist;
}
return false;
return item is MusicArtist && updateType >= ItemUpdateType.MetadataDownload;
}
private void AddAlbums(IEnumerable<MusicAlbum> albums, StringBuilder builder)

@ -130,20 +130,12 @@ namespace MediaBrowser.XbmcMetadata.Savers
public bool IsEnabledFor(IHasMetadata item, ItemUpdateType updateType)
{
var locationType = item.LocationType;
if (locationType == LocationType.Remote || locationType == LocationType.Virtual)
if (!item.SupportsLocalMetadata)
{
return false;
}
// If new metadata has been downloaded or metadata was manually edited, proceed
if ((updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload
|| (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit)
{
return item is Episode;
}
return false;
return item is Episode && updateType >= ItemUpdateType.MetadataDownload;
}
}
}

@ -118,23 +118,17 @@ namespace MediaBrowser.XbmcMetadata.Savers
public bool IsEnabledFor(IHasMetadata item, ItemUpdateType updateType)
{
var locationType = item.LocationType;
if (locationType == LocationType.Remote || locationType == LocationType.Virtual)
if (!item.SupportsLocalMetadata)
{
return false;
}
// If new metadata has been downloaded or metadata was manually edited, proceed
if ((updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload
|| (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit)
{
var video = item as Video;
var video = item as Video;
// Check parent for null to avoid running this against things like video backdrops
if (video != null && !(item is Episode) && !video.IsOwnedItem)
{
return true;
}
// Check parent for null to avoid running this against things like video backdrops
if (video != null && !(item is Episode) && !video.IsOwnedItem)
{
return updateType >= ItemUpdateType.MetadataDownload;
}
return false;

@ -71,20 +71,17 @@ namespace MediaBrowser.XbmcMetadata.Savers
public bool IsEnabledFor(IHasMetadata item, ItemUpdateType updateType)
{
var locationType = item.LocationType;
if (locationType == LocationType.Remote || locationType == LocationType.Virtual)
if (!item.SupportsLocalMetadata)
{
return false;
}
// If new metadata has been downloaded or metadata was manually edited, proceed
if ((updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload
|| (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit)
if (!(item is Season))
{
return item is Season;
return false;
}
return false;
return updateType >= ItemUpdateType.MetadataDownload || (updateType >= ItemUpdateType.MetadataImport && File.Exists(GetSavePath(item)));
}
}
}

@ -111,20 +111,12 @@ namespace MediaBrowser.XbmcMetadata.Savers
public bool IsEnabledFor(IHasMetadata item, ItemUpdateType updateType)
{
var locationType = item.LocationType;
if (locationType == LocationType.Remote || locationType == LocationType.Virtual)
if (!item.SupportsLocalMetadata)
{
return false;
}
// If new metadata has been downloaded or metadata was manually edited, proceed
if ((updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload
|| (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit)
{
return item is Series;
}
return false;
return item is Series && updateType >= ItemUpdateType.MetadataDownload;
}
}
}

Loading…
Cancel
Save