Marekkon5 / onetagger

Music tagger for Windows, MacOS and Linux with Beatport, Discogs, Musicbrainz, Spotify, Traxsource and many other platforms support.
https://onetagger.github.io/
GNU General Public License v3.0
618 stars 32 forks source link

Parse Metadata from filename problem #336

Open nmycps opened 9 months ago

nmycps commented 9 months ago

I have some files ready to be tagged with Discogs, but 100% are failing. My template seems fine. I have the Artist and album, along with the DISCOGS_RELEASE_ID all manually entered. The 'Title' tag however is currently the filename, and this is likely the reason it's failing. On one track, I fixed the title and One Tagger was able to identify it. However for the rest, parsing the filename with my template, I thought would work even if the Title is incorrect?

This is my template: %title% - %album% - %artist% - %label% - %catalognumber% - %year% - %track% Ex. Filename: 40 Years Of Anger - Nevermore E.P. - Stuart Walker - Force Inc. Music Works - FIM 173 - 1999 - Side_A1.aif

Current tags (not working): Title: 40 Years Of Anger - Nevermore E.P. - Stuart Walker - Force Inc. Music Works - FIM 173 - 1999 - Side_A1 Album: Nevermore E.P. Artist: Stewart Walker DISCOGS_RELEASE_ID: 31073

Marekkon5 commented 9 months ago

Hello, the track does not get matched by ID because 1T fetches the release, but none of the titles from the release match your track, so it falls back to the search. Search fails for similar reasons (the track title is completely different to the actual track title). As for parse filename: since you DO have the title & artist tags available, it doesn't parse it. The parse filename option works like a fallback if they're missing.

nmycps commented 8 months ago

"Hello, the track does not get matched by ID because 1T fetches the release, but none of the titles from the release match your track, so it falls back to the search. Search fails for similar reasons (the track title is completely different to the actual track title)."

Yes, they're different, but wouldn't the Artist and Album, as well as the Discogs_Release_ID suffice and overwrite the Title tag to the correct one?

"As for parse filename: since you DO have the title & artist tags available, it doesn't parse it."

Two questions: 1) It doesn't parse the filename at all or it doesn't parse only the %title% and %artist% variables? 2) 1T attempts to fetch the release on Discogs first, then if it can't find a match, it reverts to parsing the filename?

"The parse filename option works like a fallback if they're missing."

  You mean if the tags are missing from the audio file or missing from Discogs?

  My understanding of how parse filename is incorrect I suppose. I thought it would use the Filename scheme first. In my case, the filename has the correct tag info, so I hoped 1T would use it first, then go fetch the other metadata on Discogs (assuming it could find it given the Title/Album/Artist and Discogs_Release_ID already present in the file's tags.

As an aside, I notice that occasionally even if the four tags above are present and accurate in the file, 1T will fill-in the missing data from another similar release, even changing the discogs_release_id, which I thought 1T would confine itself to.

Marekkon5 commented 8 months ago

1 . 1T works on track-basis, so if DISCOGS_RELEASE_ID is present, 1T fetches the whole album, and then has to match which track from the album it is. So if the track title is too far from the discogs track title it simply won't match it.

  1. If tags are present, then filename won't be parsed at all. The parsed values are used as "fallback" if title or artist doesn't exist.

  2. 1T requires only title & track for matching, so the other values in the template are ignored (however they are important, because if you skip them then the title might become the whole filename, instead of splitting to parts and ignoring unused ones).

  3. If your DISCOGS_RELEASE_ID, Title, artist etc gets overwritten that means 1T found a match. You can disable overwriting

nmycps commented 8 months ago

I'm not able to tag some new files I made and named them based on my preferred pattern. What's the matter here? Am I setting up all wrong? As you mentioned above if there are tags present, the filename will not get parsed. Every file is skipped because no Artist tag, which it's supposed to grab from the filename. Right? Here's the portion from the .log file:

2024-02-22 23:02:31 [INFO] onetagger::socket: AutoTagger config: TaggerConfig { platforms: ["discogs"], path: Some("D:\Music\Temp_from_SD\Temp\90's House Collection Vol.2"), tags: [AlbumArt, Album, AlbumArtist, Artist, Title, Version, Remixer, Genre, Style, Label, ReleaseId, TrackId, BPM, Key, Mood, CatalogNumber, TrackNumber, ISRC, PublishDate, ReleaseDate, OtherTags, MetaTags, UnsyncedLyrics, SyncedLyrics, Explicit], separators: TagSeparators { id3: ", ", vorbis: None, mp4: ", " }, id3v24: true, overwrite: false, overwrite_tags: [AlbumArt, Album, Artist, Version, Remixer, Genre, Style, Label, ReleaseId, TrackId, BPM, Key, CatalogNumber, TrackNumber, DiscNumber, ReleaseDate, MetaTags, Title], threads: 10, strictness: 0.3, merge_genres: false, album_art_file: false, camelot: false, parse_filename: true, filename_template: Some("%title% - %album% - %artist% - %label% - %catalog number% - %year% - %track%"), short_title: false, match_duration: false, max_duration_difference: 30, match_by_id: false, multiple_matches: Default, post_command: None, styles_options: StylesToGenre, styles_custom_tag: Some(FrameName { id3: "STYLE", vorbis: "STYLE", mp4: "STYLE" }), track_number_leading_zeroes: 0, enable_shazam: false, force_shazam: false, skip_tagged: false, include_subfolders: false, only_year: true, title_regex: None, move_success: false, move_success_path: Some("D:\backups\Tech House\Tagged by 1Tagger"), move_failed: false, move_failed_path: None, write_lrc: false, enhanced_lrc: false, capitalize_genres: false, id3_comm_lang: None, multiplatform: false, custom: {}, spotify: None } 2024-02-22 23:02:31 [INFO] onetagger_autotag: Starting tagger with: 4 files! 2024-02-22 23:02:31 [INFO] onetagger_autotag: Starting tagging: 4 files, 1 threads! 2024-02-22 23:02:31 [INFO] onetagger_autotag: Starting discogs 2024-02-22 23:02:31 [INFO] onetagger_autotag: Tagging: D:\Music\Temp_from_SD\Temp\90's House Collection Vol.2\Destructor - Split EP 5 - Antonio De Angeles - Children of Tomorrow - COT18 - 2017 - Side_A2.aif 2024-02-22 23:02:31 [WARN] onetagger_autotag: Error loading file: Missing artist tag! 2024-02-22 23:02:31 [INFO] onetagger_autotag: Tagging: D:\Music\Temp_from_SD\Temp\90's House Collection Vol.2\Heterocyclic - Split EP 5 - Moteka - Children of Tomorrow - COT18 - 2017 - Side_B2.aif 2024-02-22 23:02:31 [INFO] onetagger_autotag: [discogs] State: Skipped, Accuracy: None, Path: D:\Music\Temp_from_SD\Temp\90's House Collection Vol.2\Destructor - Split EP 5 - Antonio De Angeles - Children of Tomorrow - COT18 - 2017 - Side_A2.aif 2024-02-22 23:02:31 [WARN] onetagger_autotag: Error loading file: Missing artist tag! 2024-02-22 23:02:31 [INFO] onetagger_autotag: Tagging: D:\Music\Temp_from_SD\Temp\90's House Collection Vol.2\Kompakt - Split EP 5 - Antonio De Angeles - Children of Tomorrow - COT18 - 2017 - Side_A1.aif 2024-02-22 23:02:31 [INFO] onetagger_autotag: [discogs] State: Skipped, Accuracy: None, Path: D:\Music\Temp_from_SD\Temp\90's House Collection Vol.2\Heterocyclic - Split EP 5 - Moteka - Children of Tomorrow - COT18 - 2017 - Side_B2.aif 2024-02-22 23:02:31 [WARN] onetagger_autotag: Error loading file: Missing artist tag! 2024-02-22 23:02:31 [INFO] onetagger_autotag: Tagging: D:\Music\Temp_from_SD\Temp\90's House Collection Vol.2\Scopolamine - Split EP 5 - Moteka - Children of Tomorrow - COT18 - 2017 - Side_B1.aif 2024-02-22 23:02:31 [INFO] onetagger_autotag: [discogs] State: Skipped, Accuracy: None, Path: D:\Music\Temp_from_SD\Temp\90's House Collection Vol.2\Kompakt - Split EP 5 - Antonio De Angeles - Children of Tomorrow - COT18 - 2017 - Side_A1.aif 2024-02-22 23:02:31 [WARN] onetagger_autotag: Error loading file: Missing artist tag! 2024-02-22 23:02:31 [INFO] onetagger_autotag: [discogs] State: Skipped, Accuracy: None, Path: D:\Music\Temp_from_SD\Temp\90's House Collection Vol.2\Scopolamine - Split EP 5 - Moteka - Children of Tomorrow - COT18 - 2017 - Side_B1.aif 2024-02-22 23:02:31 [INFO] onetagger_autotag: Written failed songs to: C:\Users\cshar\AppData\Roaming\OneTagger\OneTagger\config\runs\failed-1708610551380.m3u, successful to: C:\Users\cshar\AppData\Roaming\OneTagger\OneTagger\config\runs\success-1708610551380.m3u 2024-02-22 23:02:31 [INFO] onetagger::socket: Tagging finished, took: 0 seconds.

Marekkon5 commented 8 months ago

There was a bug where the template got spaces at start. Should be fixed in latest commit. Let me know if it works.

nmycps commented 8 months ago

Hi. I'm still unable to use my template. It still says 'Error loading file. Missing Artist tag'. Here's the info on my files:

image
Marekkon5 commented 8 months ago

Hello, I've just checked both no tag, and with empty title & artist tags, your filename & template and both worked. Are you sure you are using the latest commit? You could also potentially double check if your template doesn't contain quotes or some weird characters at start/end by some chance.

nmycps commented 8 months ago

After closer inspection, I noticed I had an extra space in my template, and then there was a misspelling on my part regarding the Artist in the filename that caused a 'no match'. But that took care of it. Thanks!

nmycps commented 8 months ago

After tagging 100 or so new files just now (files with 0 tags), and using my corrected template, I've noticed that in some of my filenames, if there are parenthesis anywhere it causes 1T to skip those files. Is there any way to tell 1T to include them? For example, a filename that includes the title: 'Can't Stop Dancing (Original Mix) is skipped. Or, if I have an artist such as 'Salco (Mark Dearden)' it too is skipped. In the former, Discogs lists the titles this way if there are mutiple mixes, but the latter it does not because Discogs doesn't list Artists that way. However, were there to be an 'offline switch' of using a template to parse files based on the filename, that could be useful sometimes. Then I could switch to 'online' to grab the rest of the tags.

Marekkon5 commented 8 months ago

The filename template gets converted to Regex internally, however most of the "special characters" gets escaped. In latest commit I've removed ? from that list so you can do (? and )? as an "optional" parenthesis. Example: (?%artist%)?