Open sinopsysHK opened 1 year ago
The code is quite different. Our vendored lib was patched to parse edition, and parse-torrent-title has no edition parsing I think, but I don't know how important is, but parse-torrent-title return some other fields such as directorsCut, limited, remastered, which may be similar, so we could adapt our code, adding some fields to our edition field. Edition is just used on postprocessing and path for categories.
There was a patch to fix parsing release group when the filename had extension, as the code is quite different, I think parse-torrent-title doesn't have that issue, at least it has some filenames with extension in tests/files/input.json.
The other patches on patterns.py were to improve parsing video (HEVC) and audio (E-AC3) codecs, languages parsing, support parsing 202x years, and movies whose title starts with year, such as 1917. I can see parse-torrent-title supports all of them, so I think it's better to move to that library which is maintained.
There are other differences, the new library returns encoder instead of group, and check if returns the same quality names, or need to support or rename some qualities in the result of PTN.parse.
Thank you for this detailed analysis! I might be wrong but it seems latest committed pattern.py file do not have anymore the edition patch so I suspect it is not needed in watcher!?
The latest commit removed all changes applied to our vendored lib, as I warn @barbequesauce.
Edition is still used in our code:
core/library.py: 'edition': []
core/library.py: data['edition'].append('3D')
core/library.py: data['edition'] = ' '.join(sorted(data['edition']))
templates/settings/categories.html: tags = '{title} {sort_title} {year} {resolution} {rated} {edition} {imdbid} {videocodec} {audiocodec} {releasegroup} {source} {quality}'
templates/settings/postprocessing.html: tags = '{title} {sort_title} {first} {year} {resolution} {rated} {edition} {imdbid} {videocodec} {audiocodec} {releasegroup} {source} {quality}'
The code in library gets edition from PTN so it can be used to replace tags when generating paths. But other changes may be even more important, e.g. parsing 202x years.
I have restored our changes, so we have them while someone works on migrating to the newer PTN.
Is your feature request related to a problem? Please describe. Some standard torrent file names are not well supported with original PTN lib (for instance films published in 2023 with French langage).
Describe the solution you'd like There is now a new repository https://github.com/platelminto/parse-torrent-title from platelminto who has took over original one taking new PRs
Describe alternatives you've considered Otherwise you might need to patch embedded PTN library directly.