mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 04:59:35 -07:00
Improve CF calculation for files without scene name
Fixed: Use original filename instead of complete path when calculating CF for existing file without scene name (cherry picked from commit 997aabbc3cfc3c9c5c220786d1d08cfceec5e2f2) Closes #3359
This commit is contained in:
parent
0bdd5f3278
commit
a9b16d298f
1 changed files with 5 additions and 5 deletions
|
@ -58,7 +58,7 @@ namespace NzbDrone.Core.CustomFormats
|
||||||
{
|
{
|
||||||
var parsed = Parser.Parser.ParseAlbumTitle(blocklist.SourceTitle);
|
var parsed = Parser.Parser.ParseAlbumTitle(blocklist.SourceTitle);
|
||||||
|
|
||||||
var episodeInfo = new ParsedAlbumInfo
|
var albumInfo = new ParsedAlbumInfo
|
||||||
{
|
{
|
||||||
ArtistName = artist.Name,
|
ArtistName = artist.Name,
|
||||||
ReleaseTitle = parsed?.ReleaseTitle ?? blocklist.SourceTitle,
|
ReleaseTitle = parsed?.ReleaseTitle ?? blocklist.SourceTitle,
|
||||||
|
@ -68,7 +68,7 @@ namespace NzbDrone.Core.CustomFormats
|
||||||
|
|
||||||
var input = new CustomFormatInput
|
var input = new CustomFormatInput
|
||||||
{
|
{
|
||||||
AlbumInfo = episodeInfo,
|
AlbumInfo = albumInfo,
|
||||||
Artist = artist,
|
Artist = artist,
|
||||||
Size = blocklist.Size ?? 0
|
Size = blocklist.Size ?? 0
|
||||||
};
|
};
|
||||||
|
@ -160,7 +160,7 @@ namespace NzbDrone.Core.CustomFormats
|
||||||
else if (trackFile.OriginalFilePath.IsNotNullOrWhiteSpace())
|
else if (trackFile.OriginalFilePath.IsNotNullOrWhiteSpace())
|
||||||
{
|
{
|
||||||
_logger.Trace("Using original file path for release title: {0}", Path.GetFileName(trackFile.OriginalFilePath));
|
_logger.Trace("Using original file path for release title: {0}", Path.GetFileName(trackFile.OriginalFilePath));
|
||||||
releaseTitle = trackFile.OriginalFilePath;
|
releaseTitle = Path.GetFileName(trackFile.OriginalFilePath);
|
||||||
}
|
}
|
||||||
else if (trackFile.Path.IsNotNullOrWhiteSpace())
|
else if (trackFile.Path.IsNotNullOrWhiteSpace())
|
||||||
{
|
{
|
||||||
|
@ -168,7 +168,7 @@ namespace NzbDrone.Core.CustomFormats
|
||||||
releaseTitle = Path.GetFileName(trackFile.Path);
|
releaseTitle = Path.GetFileName(trackFile.Path);
|
||||||
}
|
}
|
||||||
|
|
||||||
var episodeInfo = new ParsedAlbumInfo
|
var albumInfo = new ParsedAlbumInfo
|
||||||
{
|
{
|
||||||
ArtistName = artist.Name,
|
ArtistName = artist.Name,
|
||||||
ReleaseTitle = releaseTitle,
|
ReleaseTitle = releaseTitle,
|
||||||
|
@ -178,7 +178,7 @@ namespace NzbDrone.Core.CustomFormats
|
||||||
|
|
||||||
var input = new CustomFormatInput
|
var input = new CustomFormatInput
|
||||||
{
|
{
|
||||||
AlbumInfo = episodeInfo,
|
AlbumInfo = albumInfo,
|
||||||
Artist = artist,
|
Artist = artist,
|
||||||
Size = trackFile.Size,
|
Size = trackFile.Size,
|
||||||
Filename = Path.GetFileName(trackFile.Path)
|
Filename = Path.GetFileName(trackFile.Path)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue