Metadata Bugfixes (#1511)

* Fix XML deserialization of empty elements to integers

* Fix assumption that environment uses US time format

* Use series name as SeriesSort in epub

* Address some PR comments

* Add partial Equals(0 implementation to ComicInfo

* Update ComicInfo unittest. Revert previous version
This commit is contained in:
tjarls 2022-09-14 14:03:20 +01:00 committed by GitHub
parent 0a6e64d767
commit a1c3f43656
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 42 additions and 22 deletions

View file

@ -447,6 +447,10 @@ public class BookService : IBookService
case "calibre:title_sort":
info.TitleSort = metadataItem.Content;
break;
case "calibre:series":
info.Series = metadataItem.Content;
info.SeriesSort = metadataItem.Content;
break;
}
}
@ -609,15 +613,10 @@ public class BookService : IBookService
FullFilePath = filePath,
IsSpecial = false,
Series = series.Trim(),
SeriesSort = series.Trim(),
Volumes = seriesIndex
};
// Don't set titleSort if the book belongs to a group
if (!string.IsNullOrEmpty(titleSort) && string.IsNullOrEmpty(seriesIndex) && (groupPosition.Equals("series") || groupPosition.Equals("set")))
{
info.SeriesSort = titleSort;
}
return info;
}
}

View file

@ -647,7 +647,7 @@ public class ProcessSeries : IProcessSeries
{
var day = Math.Max(comicInfo.Day, 1);
var month = Math.Max(comicInfo.Month, 1);
chapter.ReleaseDate = DateTime.Parse($"{month}/{day}/{comicInfo.Year}");
chapter.ReleaseDate = new DateTime(comicInfo.Year, month, day);
}
var people = GetTagValues(comicInfo.Colorist);