fixes #1404 - [BUG] Emby recreating old folder name after renaming/moving folder

This commit is contained in:
Luke Pulverenti 2016-03-24 02:04:58 -04:00
parent 32b5ef7b80
commit 5d0abc280d
8 changed files with 23 additions and 10 deletions

View File

@ -69,6 +69,7 @@ namespace MediaBrowser.Api
_config.Configuration.EnableCustomPathSubFolders = true;
_config.Configuration.EnableDateLastRefresh = true;
_config.Configuration.EnableStandaloneMusicKeys = true;
_config.Configuration.EnableCaseSensitiveItemIds = true;
_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>
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>
/// Gets or sets the metadata path.
/// </summary>

View File

@ -115,7 +115,7 @@ namespace MediaBrowser.Providers.TV
{
Name = seasonName,
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);

View File

@ -422,7 +422,7 @@ namespace MediaBrowser.Providers.TV
Name = name,
IndexNumber = episodeNumber,
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);

View File

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

View File

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

View File

@ -25,14 +25,16 @@ namespace MediaBrowser.Server.Implementations.LiveTv
private readonly IUserDataManager _userDataManager;
private readonly IDtoService _dtoService;
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;
_userDataManager = userDataManager;
_imageProcessor = imageProcessor;
_logger = logger;
_appHost = appHost;
_libraryManager = libraryManager;
}
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;
return name.ToLower().GetMBId(typeof(LiveTvChannel));
return _libraryManager.GetNewItemId(name.ToLower(), typeof(LiveTvChannel));
}
public Guid GetInternalTimerId(string serviceName, string externalId)
@ -221,14 +223,14 @@ namespace MediaBrowser.Server.Implementations.LiveTv
{
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)
{
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)

View File

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