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

more template options for filenames #401

Closed
andreas-h opened this issue May 19, 2019 · 6 comments · Fixed by #536
Closed

more template options for filenames #401

andreas-h opened this issue May 19, 2019 · 6 comments · Fixed by #536
Labels
Feature New feature Needed: discussion More discussion needed before anything can be done (or still no agreement has been reached) On Hold Waiting for other actions

Comments

@andreas-h
Copy link

I think it would be useful to have more options to generate the filenames of ripped files. Especially having a DISCNUMBER would be good, as then, one could do something like DISCNUMBER-TRACKNUMBER_andsoon.flac.

As a bonus, having the option for DISCNUMBER-TRACKNUMBER_andsoon.flac in case of multi-disc releases, and TRACKNUMBER_andsoon.flac for single-disc releases would be great.

I know MusicBrainz Picard supports this using some advanced template logic.

Given that Picard is also Python, maybe using some code from Picard in whipper to implement this would be an option.

What do you think? Would you accept a PR for this (i.e., using Picard code in whipper for template generation)?

@welcome
Copy link

welcome bot commented May 19, 2019

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

To help make it easier for us to investigate your issue, please follow the contributing instructions.

@Freso
Copy link
Member

Freso commented May 19, 2019

I agree with the sentiment that it would be good to have more template options available. Can you maybe suggest a list of which ones you would like to see or find useful?

About borrowing Picard’s template system… I can almost guarantee that that won’t happen (anytime soon). Picard’s (re)naming system is way too advanced for what whipper is, at least at the current point in time. Maybe it’s something to consider once we have more/better unit tests, the code is cleaned up more from its morituri days, once it’s been ported to Python 3, etc., etc. Basically, the code has to be in a much better state than it is now before we even consider adding a significant amount of new logic to it.

@Freso Freso added Feature New feature Needed: discussion More discussion needed before anything can be done (or still no agreement has been reached) labels May 19, 2019
@JoeLametta
Copy link
Collaborator

@andreas-h Any reply?

@JoeLametta
Copy link
Collaborator

@andreas-h Any reply?

@Forage
Copy link
Contributor

Forage commented Dec 27, 2020

The only one I'm missing from the list already implemented are: disc number and disc title (which is now used for the release title).
And, as already partially suggested as well, it would be great to have a way to make a distinction between single-disc and multi-disc releases.
Maybe something like only filling the disc number variable if there are more than one discs in the selected release and the use of square brackets in the template to make that part optional if a variable instead actually contains a value.

Example, if i would be the disc number:
DEFAULT_TRACK_TEMPLATE = '%A/%d/[disc %i/]%t. %n

Which would give you
Dream Theater/A Change of Seasons/01. A Change of Seasons.flac
For the first track of the single disc release A Change of Seasons.
And
Dream Theater/Six Degrees of Inner Turbulence/disc 1/01. The Glass Prison.flac
For the first track of the first disc of the two disc release Six Degrees of Inner Turbulence

Any change for adding more template variables would require a change to stop using single character variable names as well I think. Full names would be a lot easier to understand.

@Forage
Copy link
Contributor

Forage commented Jan 6, 2021

It looks like #476 already addresses the disc number and disc title options I'd like to see. The only difference being that the disc number now defaults to 1. This prevents you from knowing if it's a single- or multi-disc release.

The last option I'd like to add to that list is the discid. Personally I'm only interested in the MusicBrainz discid, but for completeness the CDDB discid in addition to that wouldn't hurt either.

I suppose the optional part with square brackets and renaming the options to full names should be treated as two separate issues.

@JoeLametta JoeLametta added the On Hold Waiting for other actions label Jan 31, 2021
JoeLametta added a commit that referenced this issue May 16, 2021
This pull request extends the supported template variables. Additions:

- `%B`: release barcode (already included but is now allowed)
- `%C`: release catalog number (already included but is now allowed)
- `%c`: release disambiguation comment
- `%D`: disc title without disambiguation
- `%I`: MusicBrainz Disc ID
- `%M`: total number of discs in the chosen release
- `%N`: number of current disc
- `%T`: medium title

When the relative metadata is available, whipper now adds the `TRACKTOTAL`, `DISCTOTAL` and `DISCNUMBER` metadata tags to the audio tracks.

I've also taken the inspiration from pull request #476.

Resolves #401, resolves #440, resolves #448.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature Needed: discussion More discussion needed before anything can be done (or still no agreement has been reached) On Hold Waiting for other actions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants