Merge pull request #1548 from MediaBrowser/dev

Dev
This commit is contained in:
Luke 2016-03-14 01:10:49 -04:00
commit cdf869e934
19 changed files with 100 additions and 46 deletions

View File

@ -68,6 +68,7 @@ namespace MediaBrowser.Api
_config.Configuration.EnableLocalizedGuids = true; _config.Configuration.EnableLocalizedGuids = true;
_config.Configuration.EnableCustomPathSubFolders = true; _config.Configuration.EnableCustomPathSubFolders = true;
_config.Configuration.EnableDateLastRefresh = true; _config.Configuration.EnableDateLastRefresh = true;
_config.Configuration.EnableStandaloneMusicKeys = true;
_config.SaveConfiguration(); _config.SaveConfiguration();
} }

View File

@ -153,6 +153,31 @@ namespace MediaBrowser.Controller.Entities.Audio
/// <returns>System.String.</returns> /// <returns>System.String.</returns>
protected override string CreateUserDataKey() protected override string CreateUserDataKey()
{ {
if (ConfigurationManager.Configuration.EnableStandaloneMusicKeys)
{
var songKey = IndexNumber.HasValue ? IndexNumber.Value.ToString("0000") : string.Empty;
if (ParentIndexNumber.HasValue)
{
songKey = ParentIndexNumber.Value.ToString("0000") + "-" + songKey;
}
songKey+= Name;
if (!string.IsNullOrWhiteSpace(Album))
{
songKey = Album + "-" + songKey;
}
var albumArtist = AlbumArtists.FirstOrDefault();
if (!string.IsNullOrWhiteSpace(albumArtist))
{
songKey = albumArtist + "-" + songKey;
}
return songKey;
}
var parent = AlbumEntity; var parent = AlbumEntity;
if (parent != null) if (parent != null)

View File

@ -34,7 +34,17 @@ namespace MediaBrowser.Controller.Entities.Audio
{ {
get get
{ {
return GetParents().OfType<MusicArtist>().FirstOrDefault(); var artist = GetParents().OfType<MusicArtist>().FirstOrDefault();
if (artist == null)
{
var name = AlbumArtist;
if (!string.IsNullOrWhiteSpace(name))
{
artist = LibraryManager.GetArtist(name);
}
}
return artist;
} }
} }
@ -106,6 +116,15 @@ namespace MediaBrowser.Controller.Entities.Audio
return "MusicAlbum-Musicbrainz-" + id; return "MusicAlbum-Musicbrainz-" + id;
} }
if (ConfigurationManager.Configuration.EnableStandaloneMusicKeys)
{
var albumArtist = AlbumArtist;
if (!string.IsNullOrWhiteSpace(albumArtist))
{
return albumArtist + "-" + Name;
}
}
return base.CreateUserDataKey(); return base.CreateUserDataKey();
} }
@ -125,7 +144,7 @@ namespace MediaBrowser.Controller.Entities.Audio
id.AlbumArtists = AlbumArtists; id.AlbumArtists = AlbumArtists;
var artist = GetParents().OfType<MusicArtist>().FirstOrDefault(); var artist = MusicArtist;
if (artist != null) if (artist != null)
{ {

View File

@ -6,6 +6,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Runtime.Serialization;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using CommonIO; using CommonIO;
@ -85,6 +86,13 @@ namespace MediaBrowser.Controller.Entities.Movies
/// <value>The name of the TMDB collection.</value> /// <value>The name of the TMDB collection.</value>
public string TmdbCollectionName { get; set; } public string TmdbCollectionName { get; set; }
[IgnoreDataMember]
public string CollectionName
{
get { return TmdbCollectionName; }
set { TmdbCollectionName = value; }
}
/// <summary> /// <summary>
/// Gets the trailer ids. /// Gets the trailer ids.
/// </summary> /// </summary>

View File

@ -35,7 +35,7 @@ namespace MediaBrowser.LocalMetadata.Parsers
if (!string.IsNullOrWhiteSpace(val) && movie != null) if (!string.IsNullOrWhiteSpace(val) && movie != null)
{ {
movie.TmdbCollectionName = val; movie.CollectionName = val;
} }
break; break;

View File

@ -207,6 +207,7 @@ namespace MediaBrowser.Model.Configuration
public bool DownloadImagesInAdvance { get; set; } public bool DownloadImagesInAdvance { get; set; }
public bool EnableAnonymousUsageReporting { get; set; } public bool EnableAnonymousUsageReporting { get; set; }
public bool EnableStandaloneMusicKeys { get; set; }
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="ServerConfiguration" /> class. /// Initializes a new instance of the <see cref="ServerConfiguration" /> class.

View File

@ -206,12 +206,6 @@ namespace MediaBrowser.Model.Dto
/// <value>The short overview.</value> /// <value>The short overview.</value>
public string ShortOverview { get; set; } public string ShortOverview { get; set; }
/// <summary>
/// Gets or sets the name of the TMDB collection.
/// </summary>
/// <value>The name of the TMDB collection.</value>
public string TmdbCollectionName { get; set; }
/// <summary> /// <summary>
/// Gets or sets the taglines. /// Gets or sets the taglines.
/// </summary> /// </summary>

View File

@ -35,6 +35,7 @@ namespace MediaBrowser.Model.LiveTv
public string M3UUrl { get; set; } public string M3UUrl { get; set; }
public string FriendlyName { get; set; } public string FriendlyName { get; set; }
public int Tuners { get; set; } public int Tuners { get; set; }
public string DiseqC { get; set; }
public int DataVersion { get; set; } public int DataVersion { get; set; }

View File

@ -235,11 +235,6 @@
/// </summary> /// </summary>
VoteCount, VoteCount,
/// <summary>
/// The TMDB collection name
/// </summary>
TmdbCollectionName,
/// <summary> /// <summary>
/// The trailer url of the item /// The trailer url of the item
/// </summary> /// </summary>

View File

@ -1022,8 +1022,8 @@ namespace MediaBrowser.Providers.Manager
.ToList(); .ToList();
var musicArtists = albums var musicArtists = albums
.Select(i => i.GetParent()) .Select(i => i.MusicArtist)
.OfType<MusicArtist>() .Where(i => i != null)
.ToList(); .ToList();
var musicArtistRefreshTasks = musicArtists.Select(i => i.ValidateChildren(new Progress<double>(), cancellationToken, options, true)); var musicArtistRefreshTasks = musicArtists.Select(i => i.ValidateChildren(new Progress<double>(), cancellationToken, options, true));

View File

@ -107,11 +107,21 @@ namespace MediaBrowser.Providers.MediaInfo
private string GetAudioImagePath(Audio item) private string GetAudioImagePath(Audio item)
{ {
var album = item.AlbumEntity;
var filename = item.Album ?? string.Empty; var filename = item.Album ?? string.Empty;
filename += string.Join(",", item.Artists.ToArray()); filename += string.Join(",", item.Artists.ToArray());
filename += album == null ? item.Id.ToString("N") + "_primary" + item.DateModified.Ticks : album.Id.ToString("N") + album.DateModified.Ticks + "_primary";
if (!string.IsNullOrWhiteSpace(item.Album))
{
filename += "_" + item.Album;
}
else if (!string.IsNullOrWhiteSpace(item.Name))
{
filename += "_" + item.Name;
}
else
{
filename += "_" + item.Id.ToString("N");
}
filename = filename.GetMD5() + ".jpg"; filename = filename.GetMD5() + ".jpg";

View File

@ -179,7 +179,7 @@ namespace MediaBrowser.Providers.Movies
if (movieItem != null) if (movieItem != null)
{ {
movieItem.TmdbCollectionName = movieData.belongs_to_collection.name; movieItem.CollectionName = movieData.belongs_to_collection.name;
} }
} }

View File

@ -37,9 +37,9 @@ namespace MediaBrowser.Providers.Movies
var sourceItem = source.Item; var sourceItem = source.Item;
var targetItem = target.Item; var targetItem = target.Item;
if (replaceData || string.IsNullOrEmpty(targetItem.TmdbCollectionName)) if (replaceData || string.IsNullOrEmpty(targetItem.CollectionName))
{ {
targetItem.TmdbCollectionName = sourceItem.TmdbCollectionName; targetItem.CollectionName = sourceItem.CollectionName;
} }
} }
} }

View File

@ -1378,16 +1378,6 @@ namespace MediaBrowser.Server.Implementations.Dto
} }
} }
// Add MovieInfo
var movie = item as Movie;
if (movie != null)
{
if (fields.Contains(ItemFields.TmdbCollectionName))
{
dto.TmdbCollectionName = movie.TmdbCollectionName;
}
}
var hasSpecialFeatures = item as IHasSpecialFeatures; var hasSpecialFeatures = item as IHasSpecialFeatures;
if (hasSpecialFeatures != null) if (hasSpecialFeatures != null)
{ {

View File

@ -1044,11 +1044,6 @@ namespace MediaBrowser.Server.Implementations.Library
return names; return names;
} }
private void SetPropertiesFromSongs(MusicArtist artist, IEnumerable<IHasMetadata> items)
{
}
/// <summary> /// <summary>
/// Validate and refresh the People sub-set of the IBN. /// Validate and refresh the People sub-set of the IBN.
/// The items are stored in the db but not loaded into memory until actually requested by an operation. /// The items are stored in the db but not loaded into memory until actually requested by an operation.

View File

@ -90,6 +90,11 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp
if (existing == null) if (existing == null)
{ {
if (string.IsNullOrWhiteSpace(info.M3UUrl))
{
return;
}
await _liveTvManager.SaveTunerHost(new TunerHostInfo await _liveTvManager.SaveTunerHost(new TunerHostInfo
{ {
Type = SatIpHost.DeviceType, Type = SatIpHost.DeviceType,
@ -97,7 +102,9 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp
DataVersion = 1, DataVersion = 1,
DeviceId = info.DeviceId, DeviceId = info.DeviceId,
FriendlyName = info.FriendlyName, FriendlyName = info.FriendlyName,
Tuners = info.Tuners Tuners = info.Tuners,
M3UUrl = info.M3UUrl,
IsEnabled = true
}).ConfigureAwait(false); }).ConfigureAwait(false);
} }

View File

@ -860,6 +860,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
break; break;
case "collectionnumber": case "collectionnumber":
case "tmdbcolid":
var tmdbCollection = reader.ReadElementContentAsString(); var tmdbCollection = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(tmdbCollection)) if (!string.IsNullOrWhiteSpace(tmdbCollection))
{ {

View File

@ -11,7 +11,8 @@ namespace MediaBrowser.XbmcMetadata.Parsers
{ {
class MovieNfoParser : BaseNfoParser<Video> class MovieNfoParser : BaseNfoParser<Video>
{ {
public MovieNfoParser(ILogger logger, IConfigurationManager config) : base(logger, config) public MovieNfoParser(ILogger logger, IConfigurationManager config)
: base(logger, config)
{ {
} }
@ -44,12 +45,18 @@ namespace MediaBrowser.XbmcMetadata.Parsers
case "set": case "set":
{ {
var val = reader.ReadElementContentAsString();
var movie = item as Movie; var movie = item as Movie;
var tmdbcolid = reader.GetAttribute("tmdbcolid");
if (!string.IsNullOrWhiteSpace(tmdbcolid) && movie != null)
{
movie.SetProviderId(MetadataProviders.TmdbCollection, tmdbcolid);
}
var val = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(val) && movie != null) if (!string.IsNullOrWhiteSpace(val) && movie != null)
{ {
movie.TmdbCollectionName = val; movie.CollectionName = val;
} }
break; break;

View File

@ -101,9 +101,9 @@ namespace MediaBrowser.XbmcMetadata.Savers
if (movie != null) if (movie != null)
{ {
if (!string.IsNullOrEmpty(movie.TmdbCollectionName)) if (!string.IsNullOrEmpty(movie.CollectionName))
{ {
writer.WriteElementString("set", movie.TmdbCollectionName); writer.WriteElementString("set", movie.CollectionName);
} }
} }
} }