Merge pull request #1583 from MediaBrowser/dev

Dev
This commit is contained in:
Luke 2016-03-24 15:48:43 -04:00
commit 67b589ba3f
13 changed files with 58 additions and 17 deletions

View File

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

View File

@ -62,6 +62,12 @@ namespace MediaBrowser.Model.Configuration
/// <value><c>true</c> if this instance is port authorized; otherwise, <c>false</c>.</value> /// <value><c>true</c> if this instance is port authorized; otherwise, <c>false</c>.</value>
public bool IsPortAuthorized { get; set; } public bool IsPortAuthorized { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [enable case sensitive item ids].
/// </summary>
/// <value><c>true</c> if [enable case sensitive item ids]; otherwise, <c>false</c>.</value>
public bool EnableCaseSensitiveItemIds { get; set; }
/// <summary> /// <summary>
/// Gets or sets the metadata path. /// Gets or sets the metadata path.
/// </summary> /// </summary>

View File

@ -60,7 +60,8 @@ namespace MediaBrowser.Model.Configuration
EnableNextEpisodeAutoPlay = true; EnableNextEpisodeAutoPlay = true;
RememberAudioSelections = true; RememberAudioSelections = true;
RememberSubtitleSelections = true; RememberSubtitleSelections = true;
DisplayChannelsInline = true;
HidePlayedInLatest = true; HidePlayedInLatest = true;
PlayDefaultAudioTrack = true; PlayDefaultAudioTrack = true;

View File

@ -115,7 +115,7 @@ namespace MediaBrowser.Providers.TV
{ {
Name = seasonName, Name = seasonName,
IndexNumber = seasonNumber, IndexNumber = seasonNumber,
Id = (series.Id + (seasonNumber ?? -1).ToString(_usCulture) + seasonName).GetMBId(typeof(Season)) Id = _libraryManager.GetNewItemId((series.Id + (seasonNumber ?? -1).ToString(_usCulture) + seasonName), typeof(Season))
}; };
season.SetParent(series); season.SetParent(series);

View File

@ -422,7 +422,7 @@ namespace MediaBrowser.Providers.TV
Name = name, Name = name,
IndexNumber = episodeNumber, IndexNumber = episodeNumber,
ParentIndexNumber = seasonNumber, ParentIndexNumber = seasonNumber,
Id = (series.Id + seasonNumber.ToString(_usCulture) + name).GetMBId(typeof(Episode)) Id = _libraryManager.GetNewItemId((series.Id + seasonNumber.ToString(_usCulture) + name), typeof(Episode))
}; };
episode.SetParent(season); episode.SetParent(season);

View File

@ -28,9 +28,36 @@ namespace MediaBrowser.Providers.TV
: base(httpClient, configurationManager, jsonSerializer, fileSystem, localization, logManager) : base(httpClient, configurationManager, jsonSerializer, fileSystem, localization, logManager)
{ } { }
public Task<IEnumerable<RemoteSearchResult>> GetSearchResults(EpisodeInfo searchInfo, CancellationToken cancellationToken) public async Task<IEnumerable<RemoteSearchResult>> GetSearchResults(EpisodeInfo searchInfo, CancellationToken cancellationToken)
{ {
return Task.FromResult<IEnumerable<RemoteSearchResult>>(new List<RemoteSearchResult>()); var list = new List<RemoteSearchResult>();
// The search query must either provide an episode number or date
if (!searchInfo.IndexNumber.HasValue || !searchInfo.ParentIndexNumber.HasValue)
{
return list;
}
var metadataResult = await GetMetadata(searchInfo, cancellationToken);
if (metadataResult.HasMetadata)
{
var item = metadataResult.Item;
list.Add(new RemoteSearchResult
{
IndexNumber = item.IndexNumber,
Name = item.Name,
ParentIndexNumber = item.ParentIndexNumber,
PremiereDate = item.PremiereDate,
ProductionYear = item.ProductionYear,
ProviderIds = item.ProviderIds,
SearchProviderName = Name,
IndexNumberEnd = item.IndexNumberEnd
});
}
return list;
} }
public async Task<MetadataResult<Episode>> GetMetadata(EpisodeInfo info, CancellationToken cancellationToken) public async Task<MetadataResult<Episode>> GetMetadata(EpisodeInfo info, CancellationToken cancellationToken)

View File

@ -561,8 +561,7 @@ namespace MediaBrowser.Server.Implementations.Channels
{ {
throw new ArgumentNullException("name"); throw new ArgumentNullException("name");
} }
return _libraryManager.GetNewItemId("Channel " + name, typeof(Channel));
return ("Channel " + name).GetMBId(typeof(Channel));
} }
public async Task<QueryResult<BaseItemDto>> GetLatestChannelItems(AllChannelMediaQuery query, CancellationToken cancellationToken) public async Task<QueryResult<BaseItemDto>> GetLatestChannelItems(AllChannelMediaQuery query, CancellationToken cancellationToken)

View File

@ -508,7 +508,12 @@ namespace MediaBrowser.Server.Implementations.Library
.Replace("/", "\\"); .Replace("/", "\\");
} }
key = type.FullName + key.ToLower(); if (!ConfigurationManager.Configuration.EnableCaseSensitiveItemIds)
{
key = key.ToLower();
}
key = type.FullName + key;
return key.GetMD5(); return key.GetMD5();
} }

View File

@ -124,7 +124,7 @@ namespace MediaBrowser.Server.Implementations.Library
var channels = channelResult.Items; var channels = channelResult.Items;
if (user.Configuration.DisplayChannelsInline && channels.Length > 0) if (!user.Configuration.DisplayChannelsInline && channels.Length > 0)
{ {
list.Add(await _channelManager.GetInternalChannelFolder(cancellationToken).ConfigureAwait(false)); list.Add(await _channelManager.GetInternalChannelFolder(cancellationToken).ConfigureAwait(false));
} }

View File

@ -25,14 +25,16 @@ namespace MediaBrowser.Server.Implementations.LiveTv
private readonly IUserDataManager _userDataManager; private readonly IUserDataManager _userDataManager;
private readonly IDtoService _dtoService; private readonly IDtoService _dtoService;
private readonly IApplicationHost _appHost; private readonly IApplicationHost _appHost;
private readonly ILibraryManager _libraryManager;
public LiveTvDtoService(IDtoService dtoService, IUserDataManager userDataManager, IImageProcessor imageProcessor, ILogger logger, IApplicationHost appHost) public LiveTvDtoService(IDtoService dtoService, IUserDataManager userDataManager, IImageProcessor imageProcessor, ILogger logger, IApplicationHost appHost, ILibraryManager libraryManager)
{ {
_dtoService = dtoService; _dtoService = dtoService;
_userDataManager = userDataManager; _userDataManager = userDataManager;
_imageProcessor = imageProcessor; _imageProcessor = imageProcessor;
_logger = logger; _logger = logger;
_appHost = appHost; _appHost = appHost;
_libraryManager = libraryManager;
} }
public TimerInfoDto GetTimerInfoDto(TimerInfo info, ILiveTvService service, LiveTvProgram program, LiveTvChannel channel) public TimerInfoDto GetTimerInfoDto(TimerInfo info, ILiveTvService service, LiveTvProgram program, LiveTvChannel channel)
@ -200,7 +202,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
{ {
var name = serviceName + externalId + InternalVersionNumber; var name = serviceName + externalId + InternalVersionNumber;
return name.ToLower().GetMBId(typeof(LiveTvChannel)); return _libraryManager.GetNewItemId(name.ToLower(), typeof(LiveTvChannel));
} }
public Guid GetInternalTimerId(string serviceName, string externalId) public Guid GetInternalTimerId(string serviceName, string externalId)
@ -221,14 +223,14 @@ namespace MediaBrowser.Server.Implementations.LiveTv
{ {
var name = serviceName + externalId + InternalVersionNumber; var name = serviceName + externalId + InternalVersionNumber;
return name.ToLower().GetMBId(typeof(LiveTvProgram)); return _libraryManager.GetNewItemId(name.ToLower(), typeof(LiveTvProgram));
} }
public Guid GetInternalRecordingId(string serviceName, string externalId) public Guid GetInternalRecordingId(string serviceName, string externalId)
{ {
var name = serviceName + externalId + InternalVersionNumber + "0"; var name = serviceName + externalId + InternalVersionNumber + "0";
return name.ToLower().GetMBId(typeof(ILiveTvRecording)); return _libraryManager.GetNewItemId(name.ToLower(), typeof(ILiveTvRecording));
} }
public async Task<TimerInfo> GetTimerInfo(TimerInfoDto dto, bool isNew, LiveTvManager liveTv, CancellationToken cancellationToken) public async Task<TimerInfo> GetTimerInfo(TimerInfoDto dto, bool isNew, LiveTvManager liveTv, CancellationToken cancellationToken)

View File

@ -81,7 +81,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
_dtoService = dtoService; _dtoService = dtoService;
_userDataManager = userDataManager; _userDataManager = userDataManager;
_tvDtoService = new LiveTvDtoService(dtoService, userDataManager, imageProcessor, logger, appHost); _tvDtoService = new LiveTvDtoService(dtoService, userDataManager, imageProcessor, logger, appHost, _libraryManager);
} }
/// <summary> /// <summary>

View File

@ -141,8 +141,8 @@ namespace MediaBrowser.Server.Implementations.Persistence
var connectionstr = new SQLiteConnectionStringBuilder var connectionstr = new SQLiteConnectionStringBuilder
{ {
PageSize = 4096, PageSize = 4096,
CacheSize = 4096, CacheSize = 2000,
SyncMode = SynchronizationModes.Normal, SyncMode = SynchronizationModes.Full,
DataSource = dbPath, DataSource = dbPath,
JournalMode = SQLiteJournalModeEnum.Wal JournalMode = SQLiteJournalModeEnum.Wal
}; };

View File

@ -79,7 +79,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
private IDbCommand _updateInheritedRatingCommand; private IDbCommand _updateInheritedRatingCommand;
private const int LatestSchemaVersion = 48; private const int LatestSchemaVersion = 49;
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="SqliteItemRepository"/> class. /// Initializes a new instance of the <see cref="SqliteItemRepository"/> class.