Skip to main content
Topic: m-TAGS component (foo_tags) (Read 72559 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: m-TAGS component (foo_tags)

Reply #325
PSA In case anyone else arrived at this component the same way I did: be warned that this component is not a solution for foobar losing/forgetting midi file tags (it even just makes it worse, in a way). Mtags can generate its manifest file from tagged midis perfectly, but using the "write tags back to media files" feature does nothing to 90% of the files and writes tags to the wrong files for the remaining 10%. Makes sense because mtags still relies on foobar's midi tag handling, so if the latter is error-prone then mtags on midi is just as error-prone.

Re: m-TAGS component (foo_tags)

Reply #326
If someone wants to implement database tagging properly for foo_midi, be my guest. It's not working properly at this point, and definitely does not support writing RIFF MIDI tags, either.

Re: m-TAGS component (foo_tags)

Reply #327
Oh. So back in 2014 I nagged the dev. about a write-back functionality, and with that missing I dropped everything about m-tags - just to find out now, that it was implemented in 2015. Well, my loss ... until now. I think I want this, but I could use a crash course:
* For files referenced by a tags file: how to make the media library see "only one copy"?
* Is there a way to quickly scan for orphans?

Re: m-TAGS component (foo_tags)

Reply #328
* For files referenced by a tags file: how to make the media library see "only one copy"?
* Is there a way to quickly scan for orphans?
1) You might be able to exclude mtagged files by giving them a filename pattern (like .mtag.<extension>) that you can exclude through foobar's library filtering settings (the option that says "*.mpc;*.ogg" as example). Or it might be possible to generate your mtag file, then move the audio files to a path outside your library and patch the paths in the mtag file accordingly. I don't think there's a pretty solution.
2) didn't come across any. Only option I see is to parse the json file and check for orphans with an external tool/script. Very basic job if you're already into that sort of work. Using per-file mtag files would make this easier since you wouldn't even need to parse the json, just check for incomplete pairs of files.

Disclaimer: I'm not a foo_mtag expert, just a guy who checked it out, tried to make it work for his needs, tested some use cases.

Re: m-TAGS component (foo_tags)

Reply #329
I think I have found a bug in the component.

I have some albums whose tracks are in separate FLAC files named as "[tracknumber] Title.flac"

As the square brackets are special JSON character, I understand I should escape them with \[ or \]. This works when escaping the quotation marks (\"), but when the square brackets are escaped, foobar2k hangs when adding the m-tags file.

According to the JSON specifications, these characters should be automatically escaped as long as they are inside a string (i.e. enclosed by quotation marks), but that's not the case with foo_tags. I've even tried escaping with unicode character codes (\u005b and \u005d for [ and ]), but foobar still couldn't see my tracks.

Can anyone confirm?

Re: m-TAGS component (foo_tags)

Reply #330
I think I have found a bug in the component.

I have some albums whose tracks are in separate FLAC files named as "[tracknumber] Title.flac"

As the square brackets are special JSON character, I understand I should escape them with \[ or \]. This works when escaping the quotation marks (\"), but when the square brackets are escaped, foobar2k hangs when adding the m-tags file.

According to the JSON specifications, these characters should be automatically escaped as long as they are inside a string (i.e. enclosed by quotation marks), but that's not the case with foo_tags. I've even tried escaping with unicode character codes (\u005b and \u005d for [ and ]), but foobar still couldn't see my tracks.

Can anyone confirm?


m-TAGS always uses forward slashes as the directory separator as far as I can tell, so I'm gonna assume you're manually creating your JSON files.

I don't think you're actually supposed to escape square brackets either. When I generate a .tags file from a source file with a custom tag containing an actual backslash character (\) followed by a square opening bracket ([), the output in the .tags file looks like so:

Code: [Select]
"TEST" : "test\\[01] title.flac"

Only the backslash character (directory separator) is escaped.

Re: m-TAGS component (foo_tags)

Reply #331
I wish it could show the codec of playlist item on Codec columns instead of TAGS. I also wish the SDK will be updated so its not shown as unnamed legacy decoders on Decoding preferences. Regards :)

Re: m-TAGS component (foo_tags)

Reply #332
Hi everybody,

Is there a way to access the M-TAGS "@" tag field from within foobar ?
I can see it in the Properties dialog ("Details" tab), but how can I access it, in a titleformat string / masstagger script / etc. ?

FYI I'm trying to display a file's filename. That filename is of course present in the M-TAGS "@" tag field.
But I can't just type %filename%, because if will display the filename of the M-TAGS file ("!"), which is of course useless.
So what must I type ? Thanks.

EDIT - the answer is $info(@). Maybe it could be added to the OP or something, so new users don't waste their time looking for it. :)

Re: m-TAGS component (foo_tags)

Reply #333
Another question :

Let's assume that foobar is configured in the "Media Libraty" section with "*.tags" as filter. So all that foobar has in its library are now the *.tags files, not the audio files themselves.

What if we change via Windows Explorer the filename of an audio file ? How can we have M-TAGS update the corresponding *.tags file to reflect the new filename ?

Re: m-TAGS component (foo_tags)

Reply #334
I have one wish to this plugin: from selection of physical files > context menu > Tagging > Create default m-TAGS file and replace content

This command works similar like Create m-TAGS file, but autosaves the m-TAGS file into same folder with physical files under predefined name (folder.mtags, album.mtags or similar, can be defined by user prefs), then removes the selection from playlist and replaces it by opening the saved mTAGS file in one step. Then all changes into tags (including embedded artwork) would be stored to mTAGS file and the physical files remain untouched. Is possible?

Re: m-TAGS component (foo_tags)

Reply #335
So how can we currently do to find orphans ? (.tags files that don't point to the right files anymore)

Re: m-TAGS component (foo_tags)

Reply #336
* For files referenced by a tags file: how to make the media library see "only one copy"?
I wanted to be able to edit both the media files and tags in the same layout, so instead of using the "restrict file types to only see .tags" option in fb2k preferences, I instead have two tabs in the layout - '♫ Library (Tags)' and '♪ Library (Files)' - and then filter the results for genre, artist, album artist, etc (I'm using Facets plug-in for that).

So under the '♫ Library (Tags)' tab, I have one instance of Facets -
Code: [Select]
Genre / Style : $if($strstr(%filename_ext%,.tags),%<genre>%)|$if($strstr(%filename_ext%,.tags),[%<style>%])
Artist : $if($strstr(%filename_ext%,.tags),$if3(%<artist>%,%<album artist>%,'('Unknown Artist')'))

Then under the '♪ Library (Files)' tab, I have a second instance of Facets using different columns -
Code: [Select]
Genre : $if($greater(%filesize%,100000),%<genre>%)
Album Artist : $if($greater(%filesize%,100000),$if3(%<album artist>%,%<artist>%,'('Unknown Artist')'))

I'm sure there is a more elegant way of filtering that last one (tag files not likely to be over 100000 bytes, whereas most media files would be), but hey it works!  ;) (I could never figure out how to get an $if NOT statement working)

* Is there a way to quickly scan for orphans?
So how can we currently do to find orphans ? (.tags files that don't point to the right files anymore)

No easy way that I can see. However I noticed if you have a %codec% column in your tags-based playlist, and if there is an orphaned track, it sometimes displays "TAGS" instead of the codec. And you can even search the library for it (%codec% HAS tags). But this only seems to happen on occasion and I'm not sure when - perhaps after the filenames have been changed with the usual right-click > File Operations > Rename (on my Files tab above). Following that, you can right-click > Open Containing Folder, and open the .tags file in Wordpad to edit in the correct filename for that track. (Which I find is faster than making a new .tags file, because I keep my media files to only the basic tags)

Hope that helps 8)


Re: m-TAGS component (foo_tags)

Reply #337
Maybe somebody with the right skills could write a script that would :
- Scan recursively a directory for .tags files
- Scan every .tags file for all the "@" fields
- Look for the corresponding media files in the same directory as the .tags file
- If a given media file seems to be missing (either because it has been deleted or because its physical name has been changed), just add its path to a log that will be produced at the end of the scan

If only somebody could achieve this... :)

 

Re: m-TAGS component (foo_tags)

Reply #338
Hello!

I have a problem with streams. Tags are not displayed dynamically. They are fixed by. that are written in the m-tag file. Is it possible to show the values from the file when the stream is not running and display tags from stream when it is launched?

Yes it is. I already responded to this, but, in order to save you time, here is how:

You have create a "shadow" set of tags. For example, if the TITLE metadata is subject to change dynamically, do NOT create an m-TAGS file with that tag. Rather, use something like DEFAULT_TITLE (it could be the station name). Then use $if2(%TITLE%,%DEFAULT_TITLE%) to display the dynamic information when available and the m-TAGS value when not. If you use ColumnsUI, for example, the above is what you would write in the Column/Display field. And don't forget to make DEFAULT_TITLE and not TITLE the Linked Meta Field for online editing!!!

Please note that dynamic technical tags (non-metadata tags, like dynamic bit rate, etc.) are always transparently relayed by m-TAGS.

Hello!

I have a problem with streams. Tags are not displayed dynamically. They are fixed by. that are written in the m-tag file. Is it possible to show the values from the file when the stream is not running and display tags from stream when it is launched?

@Semyon:
to the previous reply I would to addition
at Columns UI/Playlist view/Columns/Scripts/Display I made this script for column "Title" for display song name during playback from stream radio (for playlists created by m-TAGS):
$if($strcmp($right(%filename_ext%,5),.tags),$if(%isplaying%,%title%,$meta(default_title)),%title%)
you can try that.

 
SimplePortal 1.0.0 RC1 © 2008-2018