Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{Release Hash} Renaming Token #6570

Closed
1 task done
Alanoll opened this issue Mar 1, 2024 · 3 comments · Fixed by #6573
Closed
1 task done

{Release Hash} Renaming Token #6570

Alanoll opened this issue Mar 1, 2024 · 3 comments · Fixed by #6573

Comments

@Alanoll
Copy link
Contributor

Alanoll commented Mar 1, 2024

Is there an existing issue for this?

  • I have searched the existing open and closed issues

Is your feature request related to a problem? Please describe

This an Anime problem, and really only if you want to retain the CRC hash on the files.
e.g.

[FroZen-EviL]_Miyuki_-_06_[DVD][2EDD54DC].mkv
[AEOG][1080p] A Couple of Cuckoos - 02 [BD HEVC 10bit Dual Audio AC3][6FB18E24].mkv

At the moment, there's no way to retain the hashes. They are currently parsed via Parser, but nothing is retained.

Describe the solution you'd like

I'd like to add the {Release Hash} token (maybe just for Anime to avoid confusion?) to the FileNameBuilder.

I don't want to retain anything in the database from the initial parse, but have it be treated similar to {Original FileName} where it's reparsed out to make it available via the token at the time of rename.

If the file is ever renamed without a CRC (via Sonarr or externally), it's gone and would have to be manually re-added to the filename. Sonarr would just have an empty token. Sonarr would never attempt to hash the file itself.

Describe alternatives you've considered

I used to use Preferred Words to keep the CRC, but it was decided in #5274 not to keep the functionality with the move to CustomFormats.

Even if #6431 is completed, CustomFormats uses the name of the CustomFormat as it's token value and not the matched value.

Anything else?

I'm just checking to see if there's any push back against the idea. I'll submit the PR.
I just thought of it when looking into what the effort would be for #6431

@markus101
Copy link
Member

I don't want to retain anything in the database from the initial parse, but have it be treated similar to {Original FileName} where it's reparsed out to make it available via the token at the time of rename.

Original FileName uses SceneName which is stored in the database as it's preferred method, it only falls back to the filename if that's not available.

If the hash is getting parsed and used in naming then it should get stored, no reason to do the work multiple times to save a little space on disk, then it'll also support it being added to naming after the fact.

@Alanoll
Copy link
Contributor Author

Alanoll commented Mar 1, 2024

So, I may be missing something.

{Original Title} returns the SceneName (and the FileName when SceneName is empty), while {Original FileName} is meant to return the filename from EpisodeFile.Path or EpisodeFile.RelativePath.

https://github.com/Sonarr/Sonarr/blob/develop/src/NzbDrone.Core/Organizer/FileNameBuilder.cs#L1089

But there's a case when GetOriginalFileName can return the empty string. Shouldn't the token {Original FileName} always returns the filename?

So this line should be passing true for the useCurrentFilenameAsFallback?

If the hash is getting parsed and used in naming then it should get stored, no reason to do the work multiple times to save a little space on disk, then it'll also support it being added to naming after the fact.

I can get started on this, and submit a PR when it's ready.

@markus101
Copy link
Member

Not if it's an existing file, otherwise subsequent renames cause the file name to grow and grow.

markus101 pushed a commit that referenced this issue Mar 10, 2024
Gauvino added a commit to Gauvino/Sonarr that referenced this issue Apr 14, 2024
Update to .NET 8 in nodejs

Fix mono version

Removes SourceLink as it should work automagically with .NET 8

Revert mono and docker file change

Re-add missing spaces

Remove clock and replace add by append

Fix missing )

New: Import list exclusion pagination

Closes Sonarr#6079

Multiple Translations updated by Weblate

ignore-downstream

Co-authored-by: Fixer <ygj59783@zslsz.com>
Co-authored-by: GkhnGRBZ <gkhn.gurbuz@hotmail.com>
Co-authored-by: Havok Dan <havokdan@yahoo.com.br>
Co-authored-by: Nicolò Castagnola <nipica@outlook.it>
Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/de/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/it/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/pt_BR/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/tr/
Translation: Servarr/Sonarr

Queue Manual Import commands at high priority

Renamed SeasonPackSpecification to ReleaseTypeSpecification

Fixed: Don't disable IPv6 in IPv6-only Environment

Closes Sonarr#6545

Update AddSeries Messaging and Logging

Properly type validation errors/warnings

New: Add download directory & move completed for Deluge

Closes Sonarr#4575

Fixed: Issue extracting subtitle information for unknown episodes

Automated API Docs update

ignore-downstream

New: Do not automatically unmonitor episodes renamed outside of Sonarr

Closes Sonarr#6584

New: Episode Requested filter for Interactive Search

Fixed: Overly aggressive exception release group parsing

Closes Sonarr#6591

Fixed: URL Base setting for Kodi connections

Remove debugger from metadata source and rearrange some imports

Persist page size for Import List Exclusions

Fix import list exclusion props

Fixed: WebApp functionality on Apple devices

Fixed: Maintain release type for items in Manual Import

Multiple Translations updated by Weblate

ignore-downstream

Co-authored-by: Havok Dan <havokdan@yahoo.com.br>
Co-authored-by: Jason54 <jason54700.jg@gmail.com>
Co-authored-by: Mark Martines <mark-martines@hotmail.com>
Co-authored-by: Maxence Winandy <maxence.winandy@gmail.com>
Co-authored-by: Stevie Robinson <stevie.robinson@gmail.com>
Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: fordas <fordas15@gmail.com>
Co-authored-by: linkin931 <931linkin@gmail.com>
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/ca/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/cs/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/de/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/el/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/es/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/fi/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/fr/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/hu/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/it/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/ko/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/nl/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/pt/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/pt_BR/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/ro/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/ru/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/tr/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/zh_CN/
Translation: Servarr/Sonarr

Automated API Docs update

ignore-downstream

Prevent NullRef in naming when truncating a null Release Group

Fixed: Error sending Manual Interaction Required notification

New: Wider modal for Interactive Search and Manual Import

Improve single file detected as full season messaging

New: 'Custom Format: Format Name' rename token

New: Release Hash renaming token

Closes Sonarr#6570

Update release profile download client warning

Fixed: Parsing of some French and Spanish anime releases

Bump ImageSharp, Polly, DryIoc, STJson, WindowsServices

New: Update Custom Format renaming token to allow excluding specific formats

Closes Sonarr#6615

Add notification for build success/failures

New: Show Series title and season number after task name when applicable

Closes Sonarr#6601

Fixed: Disabled select option still selectable

Fixed: Release push with only Magnet URL

Closes Sonarr#6622

Multiple Translations updated by Weblate

ignore-downstream

Co-authored-by: Dennis Langthjem <dennis@langthjem.dk>
Co-authored-by: DimitriDR <dimitridroeck@gmail.com>
Co-authored-by: Havok Dan <havokdan@yahoo.com.br>
Co-authored-by: Ihor Mudryi <mudryy33@gmail.com>
Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: fordas <fordas15@gmail.com>
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/da/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/es/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/fr/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/pt_BR/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/uk/
Translation: Servarr/Sonarr

Ensure not allowed cursor is shown for disabled select inputs

Sort series by title in task name

Multiple Translations updated by Weblate

ignore-downstream

Co-authored-by: Gianmarco Novelli <rinogaetano94@live.it>
Co-authored-by: Jason54 <jason54700.jg@gmail.com>
Co-authored-by: MadaxDeLuXe <madaxdeluxe@gmail.com>
Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: infoaitek24 <info@aitekph.com>
Co-authored-by: reloxx <reloxx@interia.pl>
Co-authored-by: vfaergestad <vgf@hotmail.no>
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/de/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/fr/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/it/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/nb_NO/
Translation: Servarr/Sonarr

Fixed: Task progress messages in the UI

Closes Sonarr#6632

New: Parsing multi-episode file with two and three digit episode numbers

Closes Sonarr#6631

Fixed: Plex Watchlist import list

New: Support parsing season number from season folder when importing

Closes Sonarr#903

Fixed: Don't add series from import list with no matched TVDB ID

Multiple Translations updated by Weblate

ignore-downstream

Co-authored-by: Casselluu <jack10193@163.com>
Co-authored-by: Gianmarco Novelli <rinogaetano94@live.it>
Co-authored-by: Jason54 <jason54700.jg@gmail.com>
Co-authored-by: MadaxDeLuXe <madaxdeluxe@gmail.com>
Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: infoaitek24 <info@aitekph.com>
Co-authored-by: reloxx <reloxx@interia.pl>
Co-authored-by: shimmyx <shimmygodx@gmail.com>
Co-authored-by: vfaergestad <vgf@hotmail.no>
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/ca/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/de/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/fr/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/it/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/nb_NO/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/zh_CN/
Translation: Servarr/Sonarr

Multiple Translations updated by Weblate

ignore-downstream

Co-authored-by: Altair <villagermd@outlook.com>
Co-authored-by: Dani Talens <databio@gmail.com>
Co-authored-by: Fixer <ygj59783@zslsz.com>
Co-authored-by: Stanislav <prekop3@gmail.com>
Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: fordas <fordas15@gmail.com>
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/ca/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/es/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/sk/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/tr/
Translation: Servarr/Sonarr

Fixed: Task with removed series causing error

Fixed: Use custom formats from import during rename

New: My Anime List import list

Closes Sonarr#5148

New: Advanced settings toggle in import list, notification and download client modals

Fixed: qBittorrent not correctly handling retention during testing

Fixed: Handling torrents with relative path in rTorrent

New: Add additional fields to Webhook Manual Interaction Required events

New: Allow HEAD requests to ping endpoint

Closes Sonarr#6656

Fixed: Exceptions when checking for routable IPv4 addresses

Multiple Translations updated by Weblate

ignore-downstream

Co-authored-by: Fixer <ygj59783@zslsz.com>
Co-authored-by: Havok Dan <havokdan@yahoo.com.br>
Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: fordas <fordas15@gmail.com>
Co-authored-by: 王锋 <17611382361@163.com>
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/es/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/pt_BR/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/zh_CN/
Translation: Servarr/Sonarr

Automated API Docs update

ignore-downstream

Bump version to 4.0.3

Fixed: Cleanse BHD RSS key in log files

Closes Sonarr#6666

Fixed: Path parsing incorrectly treating series title as episode number

Fixed: Deleted episodes not being unmonitored when series folder has been deleted

Closes Sonarr#6678

Fix incorrect subtitle copy regex

Do not remove all extras when script importing

Fix ignoring title based on pre-rename episodefile

Reimport files imported prematurely during script import

Fixed: Use widely supported display mode for PWA

New: Informational text on Custom Formats modal

Improve text for file deleted through UI/API

New: Footnote to indicate some renaming tokens support truncation

Fixed: Sending ntfy.sh notifications with unicode characters

Closes Sonarr#6679

New: Set 'Release Type' during Manual Import

Closes Sonarr#6681

Fixed: Skip move when source and destination are the same
ignore-downstream

Co-Authored-By: Colin Hebert <makkhdyn@gmail.com>
(cherry picked from commit 7a5ae56)

Multiple Translations updated by Weblate

ignore-downstream

Co-authored-by: Fixer <ygj59783@zslsz.com>
Co-authored-by: Jason54 <jason54700.jg@gmail.com>
Co-authored-by: Michael5564445 <michaelvelosk@gmail.com>
Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/fr/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/ro/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/uk/
Translation: Servarr/Sonarr

Fixed: Improve AniList testing with Media filters

New: Option to prefix app name on Telegram notification titles

Add DevContainer, VSCode config and extensions.json

New: Auto tag series based on tags present/absent on series

Closes Sonarr#6236

Fixed: Renaming episodes for a series

Closes Sonarr#6640

New: Detect shfs mounts in disk space

Prevent multiple enumerations in Custom Formats token

Fixed: Changing Release Type in Manage Episodes

Closes Sonarr#6706

Multiple Translations updated by Weblate

ignore-downstream

Co-authored-by: Havok Dan <havokdan@yahoo.com.br>
Co-authored-by: fordas <fordas15@gmail.com>
Co-authored-by: myrad2267 <myrad2267@gmail.com>
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/es/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/fr/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/pt_BR/
Translation: Servarr/Sonarr

Automated API Docs update

ignore-downstream

New: Parse absolute episode numbers within square brackets

Closes Sonarr#6694

Multiple Translations updated by Weblate

ignore-downstream

Co-authored-by: Havok Dan <havokdan@yahoo.com.br>
Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: YSLG <1451164040@qq.com>
Co-authored-by: fordas <fordas15@gmail.com>
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/es/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/pt_BR/
Translate-URL: https://translate.servarr.com/projects/servarr/sonarr/zh_CN/
Translation: Servarr/Sonarr

Improve release notes for main releases

Improve build step dependencies

Bump version to 4.0.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants