remove obsolete markings

This commit is contained in:
Luke Pulverenti 2014-06-29 23:32:43 -04:00
parent 3d47b495a9
commit 62d98551ed
9 changed files with 43 additions and 76 deletions

View File

@ -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>

View File

@ -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)
{

View File

@ -36,12 +36,22 @@ 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;
if (person != null)
{
var items = _libraryManager.RootFolder.RecursiveChildren;
items = person.GetTaggedItems(items).ToList();
foreach (var item in items)
{
@ -49,9 +59,16 @@ namespace MediaBrowser.XbmcMetadata
}
}
}
}
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)

View File

@ -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");

View File

@ -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)

View File

@ -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;
}
}
}

View File

@ -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;
// Check parent for null to avoid running this against things like video backdrops
if (video != null && !(item is Episode) && !video.IsOwnedItem)
{
return true;
}
return updateType >= ItemUpdateType.MetadataDownload;
}
return false;

View File

@ -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)));
}
}
}

View File

@ -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;
}
}
}