HydrogenAudio

Hosted Forums => foobar2000 => 3rd Party Plugins - (fb2k) => Topic started by: Case on 2018-06-17 11:59:00

Title: External Tags
Post by: Case on 2018-06-17 11:59:00
External Tags (http://www.foobar2000.org/components/view/foo_external_tags) is a new experimental component that allows tagging file formats that don't natively support tagging.

The component requires foobar2000 v1.4 version as it utilizes the new decoder priority configuration.

The component was created to allow ReplayGaining (https://hydrogenaud.io/index.php/topic,116045.msg958300.html#msg958300) tracker modules but it may be useful for other purposes too.
Title: Re: External Tags
Post by: Eclipsed Moon on 2018-06-17 15:42:00
I'd like to try it out, but I don't see how to set the component's priority as instructed.
Title: Re: External Tags
Post by: fbuser on 2018-06-17 15:46:54
Preferences ->Playback -> Decoding.
Title: Re: External Tags
Post by: Case on 2018-06-17 17:59:38
When the component is installed the decoder priorities are correct. They may need adjusting when you install new decoder components or old ones are updated to include the new decoder priority control.
Title: Re: External Tags
Post by: DVS on 2018-06-19 18:01:11
Hi, is it possible to implement the addition of selective tags to an external file, and add the rest of the tags as usual? (For example, to save personal or confidential tags separately from the music file). Thanks.
Title: Re: External Tags
Post by: Case on 2018-06-19 18:50:43
In theory but it would be messy. If you wish to do that you can move the (writer) part to the top of the decoder list, write the info you don't want to go to the files, then move the writer back to bottom.
Title: Re: External Tags
Post by: EpicForever on 2018-06-20 07:07:44
Confidential tags... What the hell could it be?
Title: Re: External Tags
Post by: Sergey77 on 2018-06-20 19:39:42
@Case, is it possible use External Tags component for edit metadata field for stream items in playlist (for example stream radio station) ?
Thanks.
Title: Re: External Tags
Post by: Case on 2018-06-21 11:44:08
It should be but tag writing routines don't seem to get called for streams. I'll probably need to consult Peter to see how to circumvent that restriction.
Title: Re: External Tags
Post by: Akel on 2018-06-24 01:56:25
What's the diference between this and the M-Tags plugin?
Title: Re: External Tags
Post by: Case on 2018-06-24 08:23:23
It's my understanding m-TAGS component requires loading files you want to tag to a playlist, use a menu entry to create tag files, remove the files from playlist and load the newly created tag files in their place.

This component will use external tags transparently. Just edit tags and they will be written as APEv2 tags next to the files you tagged. Load any file and external tags will be read if they exist.
Title: Re: External Tags
Post by: Sergey77 on 2018-06-24 17:24:49
I believe External Tags component can to have more potential and advantages in TAG edit, if @Case will progress it of course.
I personally like ease of use.
Title: Re: External Tags
Post by: sveakul on 2018-06-26 03:58:15
It should be but tag writing routines don't seem to get called for streams. I'll probably need to consult Peter to see how to circumvent that restriction.
Case a strong +1 for this from me, as Sergey77 mentions it would be great to have an easier to use, transparent option to m-TAGs in order to tag radio stream playlists, which are desperately in need of a way to show a fixed station name on each URL entry, etc.  I hope you will follow up with Peter on a solution.
Title: Re: External Tags
Post by: Case on 2018-06-26 08:46:22
I did ask Peter about it and it's apparently not too easy to accomplish. But I have already added a workaround that just needs some finishing touches.
Title: Re: External Tags
Post by: anamorphic on 2018-06-26 08:48:38
It should be but tag writing routines don't seem to get called for streams. I'll probably need to consult Peter to see how to circumvent that restriction.
Case a strong +1 for this from me, as Sergey77 mentions it would be great to have an easier to use, transparent option to m-TAGs in order to tag radio stream playlists, which are desperately in need of a way to show a fixed station name on each URL entry, etc.  I hope you will follow up with Peter on a solution.
Just FYI, you can do that already with m-TAGs (https://hydrogenaud.io/index.php/topic,97164.msg958135.html#msg958135) (as @Sergey77 posted), although as you say not automated. m-TAGs is quite handy for streams because you can even add artwork for each radio station / m-TAGs file (go to somewhere like onlineradiobox.com to find stations and art/logo)

Although yes, it would be nice to have an easy alternative. +1 to that. ;)
Title: Re: External Tags
Post by: sveakul on 2018-06-28 06:01:36
I did ask Peter about it and it's apparently not too easy to accomplish. But I have already added a workaround that just needs some finishing touches.
Thanks Case, looking forward to seeing this new version when it is ready! :)
Title: Re: External Tags
Post by: Porcus on 2018-06-28 23:39:18
Preferences ->Playback -> Decoding.

Suggestion: Put this information in the "About" box. People will search under Tools or Advanced.
* Also, will "writer" work "properly" if priority is higher, if the user wants external tags to overrule internal?
* Furthermore: if priority changes (by new or updated codecs, or user error): will reinstalling the component just rectify this? (If so, is there a way to do this simple?)

Let me suggest a text like e.g. the following (provided of course, that it is factually correct):

Adds tagging support for non-taggable file formats.
The tags are written as external files to the same directory as the target audio files.

For the component to work properly the "External Tags (reader)" decoder must have higher priority than the format to be tagged.
The "External Tags (writer)" decoder should have lowest priority unless you want external tags to take priority over native tags of any format.
Priority rules rules are automatically set correctly when foo_external_tags is installed. If codecs are installed or updated later, you may want to review priority rules (Preferences -> Playback -> Decoding) or simply reinstall foo_external_tags.
Title: Re: External Tags
Post by: Case on 2018-06-29 20:48:39
Thanks for the suggestion, Porcus. I'll steal your text with some edits if I'll release a new version. Your assumptions about the writer are correct. But re-installing the component doesn't fix decoder priorities. The core seems to remember positions even for removed components and reinstall returns the old order.

I have some bad news about the stream handling. My component seems to be completely circumvented by the FFmpeg decoder wrapper, which is required to support at least HLS streams. I can't make custom tags show up for this scenario.

Album art extractor is hardcoded not to run for streams so I can't show album art.

The latter problem could be kind of circumvented by loading a custom wrapper file instead of the actual stream and by handling the streaming hidden behind the scenes. But this confuses other components. For example Waveform Minibar thought it's dealing with a local file and tried to extract waveform never succeeding... And trying to wrap FFmpeg decoder wrapper this way appears to always fail.

Sorry for letting you down.
Title: Re: External Tags
Post by: sveakul on 2018-06-30 04:23:11
"Letting you down"?? ???  hey Case you gotta be kidding, THANK YOU for the work on this and for what it does!!  I don't run any HLS streams so for me at least that part is a non-issue.  The album art per URL absence due to the hardcoding is a drag but I've still got 4 "stub" images to pick from in normal display prefs which suffice for my radio moods..  MOST of them, haha.  Thanks again for all the work you do on all of your invaluable plugins  :) !
Title: Re: External Tags
Post by: Case on 2018-06-30 12:54:56
New version released. Biggest changes are the added album art support for local files and text-based tag support for streams.

Note that the regular Properties dialog won't attempt to save anything with streams. It's probably a bug that it's even allowed to be opened. Stream tagging requires using Tagging -> Edit External Tags context menu command. Tags added that way won't show up immediately on the playlist but once the stream is opened and stopped the edited tags should be visible.

Context menu also has a hidden-by-default menu entry for removing external tag files from selected tracks. It's visible when opening the menu while holding shift or can be made permanently visible in the context menu settings.

And files that have external tags can now be found if needed as $info(tagtype) will return "External APEv2" for them.
Title: Re: External Tags
Post by: Anakunda on 2018-06-30 14:24:08
My question to this plugin:
Can I somehow force it to use external file even for tagable formats (e.g. FLAC) but only per choice?
Is the plugin deciding completely automatically when it would be used and when not?
Eventually I could accept using external tags always for given format.
Title: Re: External Tags
Post by: Case on 2018-06-30 14:48:21
What kind of choice are you after? If you drag FLAC below the external tag writer in the decoder priority list no FLACs will get altered and they will get external tags instead. I could enable the context menu command for external tag adding for all formats and not just streams, but I don't really see the point.
Title: Re: External Tags
Post by: Porcus on 2018-06-30 16:46:33
If you drag FLAC below the external tag writer in the decoder priority list no FLACs will get altered and they will get external tags instead. I could enable the context menu command for external tag adding for all formats and not just streams, but I don't really see the point.

Since there is m-TAGS, I take it that there is indeed a demand for external tag files even for tag-able formats. (It is not a bad thing for maintaining a backup - you can run a backup on the tag files first, and then check what audio files have actually changed, and ...)

However, those who want that consistently should rather drag the Writer up to top priority? (Or second, after the tag Reader?)

A suggestion then:
A function to commit tags to media files - if different. (Overwriting only if there is any change.)
(Ideally, I would want to search for those files too, but that is likely quite a fuss?)
Title: Re: External Tags
Post by: Sergey77 on 2018-06-30 18:15:00
New version released. Biggest changes are the added album art support for local files and text-based tag support for streams.
Unbelievable!
@Case, you make us happy  :)
Thank you and respect for You, Coder!
We will try.
"Letting you down"?? ???  hey Case you gotta be kidding, THANK YOU for the work on this and for what it does!!  I don't run any HLS streams so for me at least that part is a non-issue.  The album art per URL absence due to the hardcoding is a drag but I've still got 4 "stub" images to pick from in normal display prefs which suffice for my radio moods..  MOST of them, haha.  Thanks again for all the work you do on all of your invaluable plugins  :) !
@sveakul, looks like you supported to @Case on time! Thanks!
Title: Re: External Tags
Post by: Sergey77 on 2018-06-30 20:08:51
I want to add a logo (.png from onlineradiobox (http://onlineradiobox.com/) thanks to @anamorphic) for stream radio item at playlist.
Case, could you tell, how can i do that with External Tags ?

Thanks.
Title: Re: External Tags
Post by: Anakunda on 2018-06-30 22:08:45
I could enable the context menu command for external tag adding for all formats and not just streams, but I don't really see the point.

Yes this. I see a point. Add a menu command like Force dump existing tags to external file for any format.
Eventually moving flac under external tags writter could also work but I don't want to move the flac too low as there's ffmpeg decoder which would take precedence.  Thanks.
m-Tags is too complicated for that purpose (save/remove/open)
Title: Re: External Tags
Post by: sveakul on 2018-07-01 04:28:46
I want to add a logo (.png from onlineradiobox (http://onlineradiobox.com/) thanks to @anamorphic) for stream radio item at playlist.
Case, could you tell, how can i do that with External Tags ?

Hi Sergey77:  as Case said in Reply#19 the new version adds album art support only for "local files", I assume what you ask cannot be done, due to the problem he mentioned with the art extractor hardcoded not to work for streams.  Of course, I would be glad to be proved wrong!!
Title: Re: External Tags
Post by: zoomorph on 2018-07-01 05:51:58
This is interesting! Could this potentially replace m-TAGS as a simpler solution to the problem of "never edit internal tags unless (rarely) specifically requested"?
- If external tags aren't present and tags for a file are changed, new tags should be written to external tags and not to internal tags.
- If external tags are present, context menu option to write external tags to internal tags.
 
Or is m-TAGS better because it's explicit whether you're working with the files themselves or the external tags? Perhaps that is better, but m-TAGS has other disadvantages when working with external tags that this solution (I think) would not (file operations don't work well).
Title: Re: External Tags
Post by: Sergey77 on 2018-07-01 05:54:43
I want to add a logo (.png from onlineradiobox (http://onlineradiobox.com/) thanks to @anamorphic) for stream radio item at playlist.
Case, could you tell, how can i do that with External Tags ?
Hi Sergey77:  as Case said in Reply#19 the new version adds album art support only for "local files"...
Hi sveakul!
Exactly, but I see that picture code is added to the .tag file (in external-tags folder) when I click Tagging/Attach picture/Artist for stream item. Also creates .tag file in external-tags folder for HLS item, but changes aren't displayed during playback.
We will hope...

Title: Re: External Tags
Post by: Case on 2018-07-02 06:52:28
The cover art reading code is present and active for everything, but it doesn't get called with streams. I currently have no solution for this.

@zoomorph I know there are people using the component for exactly that purpose. If you alter the decoder priorities and place the writer component above other decoders it will steal tag writes for everything. You can actually disable the tag reader part and just use the writer on top. It can perform all the operations on its own.

I'll see about improving the usage with taggable formats.
Title: Re: External Tags
Post by: Porcus on 2018-07-03 15:55:37
The following is not expected behaviour?

Selecting a track and looking at "General", it gives me "Tag type": "External APEv2" although there are none.
Converting FLAC to FLAC writes .tags files.
Furthermore, the FLAC files appear untagged, until I delete the .tags.

Version 0.6, with the Writer at the bottom of priorities, yes. fb2k 1.4beta17.
Title: Re: External Tags
Post by: Anakunda on 2018-07-03 19:01:07
I'm experiencing also writings dozen  of .tags files when embedding artwork into FLAC tracks (External tags writer at last slot also)
Title: Re: External Tags
Post by: Case on 2018-07-04 07:16:32
Sorry about that, fixed version of the component is up.

Tag reader was accidentally active even for tracks without external tag files and that caused the tagtype field to be erroneously reported. Forcing re-read of tags for affected tracks will correct the display mistake.

Album art editor isn't tied to any decoder and thus their priority order was probably random. The new version will only be active for files that have .tags files present for them.

This was baked from my work-in-progress version and its context menu also allows force-writing external tag for every file even when tag writer decoder is at the bottom. Though I realized it may be confusing, tag type shows External APEv2 in properties but if you edit it, it will get written to format's native tags.
Title: Re: External Tags
Post by: Porcus on 2018-07-04 21:23:43
New bug. Converted FLAC to FLAC and got
An error occurred while transferring attached pictures (Unsupported file format) : "g:\¤¤¤\tmp\Ifwhen - Null Set - 01 Linked.flac"
Disappeared when I uninstalled the component.
Title: Re: External Tags
Post by: Anakunda on 2018-07-04 21:56:45
Nice, the Edit External Tags is step the right direction, but it still suffers some flaws in consistency and writting logic:

- after creating .tag files and consequently using converter, the external metadata take precedence, but on opening foobar2000's properties, the old content is there, ie. not reflecting fresh external metadata
- on files removal and re-reading the folder content, the .tag content is already shown in properties, but on making any change to metadata via standard properties dialogue, the updated metadata are written to physical files instead to .tag files (intuitively they should be written to .tag files if they exist). My idea is to write ANY change to metadata to .tag files if they exist
- when doing RG scan, the RG info is still written to original files regardless if related .tag file exist or not, and this will probably apply to any other scanning task (BPM scanner, Lyrics grabber etc.)
- when enforcing external tags on multitrack file (CUEsheet), and reopening the cuesheet, the tags show up as total mess
- I have suggestion to write all external tags within one folder to single .tag file with predefined name instead of bunch of single .tag files for each track
Title: Re: External Tags
Post by: Anakunda on 2018-07-04 23:21:18
New bug.
An error occurred while transferring attached pictures (Unsupported file format) : "g:\¤¤¤\tmp\Ifwhen - Null Set - 01 Linked.flac"

Yeah editing embedded artwork causes error now on all formats. Indeed a bug

"Picture editing failed: Unsupported file format"
Title: Re: External Tags
Post by: Case on 2018-07-05 06:10:41
Component reverted to v0.5 before all the mess.
Title: Re: External Tags
Post by: sveakul on 2018-07-06 02:09:40
Case is it still "safe" to keep using the latest July 4th release if all we are doing is text-tagging radio stream entries?  Or will that technique be changing somehow with your next version so that waiting is recommended?
Title: Re: External Tags
Post by: Case on 2018-07-06 17:06:51
It's safe. If I change some format I'll maintain backwards compatibility.
Title: Re: External Tags
Post by: sveakul on 2018-07-07 00:10:38
Thanks Case!  This valuable plugin is needed and I know you'll work out the bugs, thanks for keeping us radio stream aficionados in mind.
Title: Re: External Tags
Post by: Case on 2018-07-14 22:32:32
New version up. Hopefully all the bugs are gone now.
Title: Re: External Tags
Post by: Anakunda on 2018-07-15 05:32:52
Thanks!
I still have bugs with reading external tags

Album > context menu > Tags > Edit external tags > make changes > Apply
Album > context menu > Replay Gain > Scan as a single album
RG is now stored only in tag files (right)
But Album > context menu > Properties shows no tags and that even on removing/readding folder to playlist
After tags files are created, the tracks metadata can only be shown by Tagging > Edit external tags
If that's by design, can also context menu > Properties command be redirected to Edit external tags, so that built in Properties command will always show actual metadata, and the same for Masstager and other 3rd party plugins
Title: Re: External Tags
Post by: Case on 2018-07-15 07:55:13
Currently the metadata you add with the context command won't be refreshed to the player automatically. Hacks require hacky workarounds to solve, I had a callback to reload info after tags were saved but it did not work. I can try other methods but for now you need to manually reload info for changes to be visible. And with streams you need to actually play them for the info to kick in.

I'm pretty sure Properties dialog can't be redirected.
Title: Re: External Tags
Post by: sveakul on 2018-07-29 02:56:02
Case, just wanted to say how much I enjoy using this plugin for my radio streams playlist.  I'm able to provide actual station names that stick (and genres), when previously having to deal with entries like "/" or "opus".  This thing is a beast, and so EASY to use right from context menu.  I also appreciate the fact that the tags are logically stored in their own folder right in Foobar instead of hidden in some "temp files" or other directory, and deleting a tag is equally as simple right from the context menu.  There's just no way to mess things up!  And easier to use than M-Tags.

Just as a FYI to other users, I noticed that an external tag is created (if none had existed) as soon as "Edit External Tags" is selected from the Tagging context menu.  If you choose it by "accident", or just decide you don't want to create the tag after all, hitting the "Cancel" button when the properties dialog appears does not stop a tag from being created.  Perhaps a better label for "Edit External Tags" would be "Create/Edit External Tags."

Thanks again and here's hoping the FB core will someday allow you to add artwork for radio stream external tags (a nod to Sergey77!).
Title: Re: External Tags
Post by: swanmaiden on 2018-07-29 10:54:15
I was in desperate need of this. Thank you so much.
Now I can manage my sheet music library inside foobar.
Title: Re: External Tags
Post by: Nisto on 2018-07-30 22:38:36
I've had a (probably crazy) idea for a tag storing solution for some time. Currently, with both m-TAGS and External Tags, we are unable to rename files without losing the associated tags, because the audio data and tag data are stored in separate files. One solution that I think might remedy this is to use NTFS alternate data streams (ADS). Aside from people potentially being unaware of its existence, is there any reason this has not or can not be done with a foobar2000 component? According to this site (https://wiki.sep.de/wiki/index.php/Support_for_NTFS_alternate_data_streams_(ADS)_for_Windows) there isn't any known size limit.

Quote from: SEP
There is no official limit to the size of the content that can be stored in the streams or to the number of streams, therefore the files with ADS can get quite big.
Title: Re: External Tags
Post by: Case on 2018-07-31 10:19:27
I actually thought about using NTFS streams at first but decided against it. The streams are hidden from regular users and they are easy to lose. They don't survive copying or archiving and can't be used for example on linux based NAS devices. I think a simple more transparent method is better. External tag is immediately visible and rather easy to rename or copy or move together with the media file in file managers.
Title: Re: External Tags
Post by: Nisto on 2018-07-31 13:33:10
They don't survive copying or archiving and can't be used for example on linux based NAS devices.

Hmm, under what circumstances doesn't ADS survive copying? I use Windows 7 SP1 (Ultimate, if that matters), and all streams are copied via Explorer, both if I use Copy and Cut. Also, WinRAR will store alternate streams if specified. I wouldn't be surprised if 7-Zip has an option too. I don't use a NAS personally, and I'd tend to agree with you on the points of transparency and portability, but in my personal opinion, tagging is such a difficult problem to solve. And I think ADS would solve more than a couple of problems. For example:
- renaming, as mentioned
- clutter (every single audio file has a corresponding .tag file with External Tags)
- file info propagation (m-TAGS shows Location info on the .tags file rather than the actual audio file)

Would it be difficult to add a second interface to External Tags that would allow you to make use of alternate streams instead? I understand if it's not easy to maintain and everything, so please don't do any more than you're willing to.
Title: Re: External Tags
Post by: Porcus on 2018-07-31 15:17:05
I actually thought about using NTFS streams at first but decided against it. The streams are hidden from regular users and they are easy to lose. They don't survive copying or archiving and can't be used for example on linux based NAS devices. I think a simple more transparent method is better. External tag is immediately visible and rather easy to rename or copy or move together with the media file in file managers.

Considered using both? Those who could think of editing the tag file "by hand", would probably understand a help file.
Title: Re: External Tags
Post by: sveakul on 2018-07-31 19:55:14
I actually thought about using NTFS streams at first but decided against it. The streams are hidden from regular users and they are easy to lose. They don't survive copying or archiving and can't be used for example on linux based NAS devices. I think a simple more transparent method is better. External tag is immediately visible and rather easy to rename or copy or move together with the media file in file managers.

My vote will always be for "easy" and "visible" over "complex" and "hidden."  That is what makes External Tags such a relief to use.  Just my opinion.
Title: Re: External Tags
Post by: Case on 2018-07-31 23:32:42
Hmm, under what circumstances doesn't ADS survive copying?
It isn't retained here when copying or moving from one drive to another.

I just uploaded version 0.9 of the component where I added an optional feature to use NTFS Alternate Data Streams for storing the tags. The setting is found under Tagging section of advanced preferences.
Note that the component will not automatically remove .tag files and those will be used for tag writing if they exist. To switch from .tag to stream, the old files need to be removed.
Title: Re: External Tags
Post by: sveakul on 2018-08-01 00:21:59
Man you're fast  :o !  But THANKS for holding on to the "easy and visible" option as well.  I guess sometimes you really CAN "please everybody"   :)
Title: Re: External Tags
Post by: Nisto on 2018-08-01 13:18:35
That was fast indeed! I never would've expected it so soon considering ADS is not all that well documented. Seriously, you're my hero of the year. Maybe I can finally get some sleep at last.
Title: Re: External Tags
Post by: DVS on 2018-08-01 20:13:59
The Tag Reader is marked and located on top. All previous (internal) disappear when an external tag is inserted.
With the tag reader unchecked, the internal tags are displayed again.
Version 0.8-0.9
What could be the problem?
Title: Re: External Tags
Post by: Case on 2018-08-01 20:53:34
What do you mean exactly? The external tag overrides internal one and that is by design. If you add a blank external tag it will look like the file has no tag at all. But that should require you to remove all the fields yourself, by default when you create a tag it should have all the values from the internal tag.
Title: Re: External Tags
Post by: DVS on 2018-08-01 21:21:48
When the checkbox is activated, all other tags are lost, including newly added external ones.
(https://i102.fastpic.ru/big/2018/0802/6b/857b8cb73641a1e51c3db05f98df7d6b.gif)
Title: Re: External Tags
Post by: Case on 2018-08-01 21:36:07
Is that a file you added an external tag to? It sounds like it is and the external tag is empty. If you hold shift, right click the file and select Tagging -> Remove External Tags your file should return to normal. At least after you reload metadata.

But how did you get into this situation? Is there a bug causing this or did you do something unexpected?
Title: Re: External Tags
Post by: DVS on 2018-08-01 21:58:34
This happens when adding a non-empty external tag. I can't understand the reason.
(https://i101.fastpic.ru/big/2018/0802/ca/d1c206775f3bd7f8b17f7f56a0a5a1ca.gif)
Title: Re: External Tags
Post by: Case on 2018-08-01 22:03:05
You don't give much information. Another situation I can think of is that you are dealing with cue sheets or other tracks with multiple subsongs and you only tag a single subsong. The file gets a new tag but only the subsong you tagged will have any information in it.

If it's something else tell at least what file format you are dealing with.
Title: Re: External Tags
Post by: DVS on 2018-08-01 22:08:43
This is a normal FLAC track, without CUE. "foobar2000 FLAC Decoder" is below the External Tags (writer) level.
PS. I just checked on a clean foobar2000 installation, the problem repeats. Maybe I'm doing something wrong. I will understand further.
Title: Re: External Tags
Post by: Case on 2018-08-01 22:19:47
Perhaps show what you do because I can't make it fail.
Title: Re: External Tags
Post by: DVS on 2018-08-01 23:44:24
I noticed the *.tag file is present, and it is not empty however, for some reason the data is not readable. Foobar displays an empty window because of this. Also, the problem is only in versions 0.8-0.9. Version 0.6 and below, external tags displays.
Title: Re: External Tags
Post by: Case on 2018-08-02 00:11:21
Sounds weird. I'll attach a debug version here that will report all exceptions to the console. Hopefully that will reveal what's going on.

Edit: attachment removed.
Title: Re: External Tags
Post by: DVS on 2018-08-02 00:28:29
at the time of adding an external tag:
External Tags - get_file_stats error: Object not found
External Tags - get_info error: Object not found
External Tags - 0 fields loaded
Title: Re: External Tags
Post by: Case on 2018-08-02 01:29:31
Alright, you were tagging with the regular Properties dialog. I hadn't tested that scenario since adding the context menu command to force external tag to any format.

The issue should be fixed in External Tags v0.9.1 (https://foobar.hyv.fi/?view=foo_external_tags). If everything works properly for you I'll put it on the repository when I wake up.
Title: Re: External Tags
Post by: DVS on 2018-08-02 02:48:54
I did not even pay attention to the special dialogue, believing that this is a duplicate of the standard only.
Now, it works, thanks!
Title: Re: External Tags
Post by: Porcus on 2018-10-19 19:47:48
Case, I know this question is outside the original intended use ("don't natively support tagging") but:

THE way to commit external tags back to internal would be
[(0) create .tag files, not ADS]
(1) Select the files in question
(2) Open Properties, and with Properties open:
(3) Delete the .tag files, or at least move them out of the way
(4) Make some change to the Properties, so that Apply lights up
(5) Apply or OK it
?

Title: Re: External Tags
Post by: Case on 2018-10-19 21:34:06
That works. Should work with ADS too, unless there's a bug somewhere.
Title: Re: External Tags
Post by: Case on 2018-10-20 12:14:35
@Porcus - new version released with a Commit context menu command (hidden by default). It will read the tags and possible album art, write the tags to file, remove the external tags file on success, then attempts to write the album art to the target. Album art handling here may be unnecessary code as I believe my component can only take over that functionality when the format doesn't support it natively.
Title: Re: External Tags
Post by: Porcus on 2018-10-20 13:28:51
RED FLAG! @Case :  Commit ate my tags. It left CDTOC and MUSICBRAINZ_whatevers, and the rest were cone.

FLAC files, new fb2k beta 4.
Title: Re: External Tags
Post by: Porcus on 2018-10-20 16:01:51
The remaining fields were "spam meta fields" in my LargeFieldsConfig.txt, and at least the following seems to provoke the behaviour consistently; some need Shift-rightclick.

Start with no external tags
Tagging -> Edit External Tags
Tagging -> Rewrite File Tags
Tagging -> Commit External Tags to file

I have issues getting the Commit up if I do not do anything to it in the meantime.

cone.

"gone", of course.
Title: Re: External Tags
Post by: Case on 2018-10-20 16:16:53
Thanks for the quick warning. I had tested it with previously untagged files and didn't see issues initially. New version uploaded that shouldn't cause such problems anymore.

Note that the Commit and Remove commands aren't visible unless foobar2000 reads the actual external tags. Until I fix automatic info refresh for forced external tags the most reliable way to make them show up is to reload info.

I hope you don't find more issues as I don't want to run out of version numbers. There are still some features missing before I can call it 1.0.
Title: Re: External Tags
Post by: Sergey77 on 2018-10-20 16:39:26
@Case, please take a look why HLS links stop works with External Tags?
error message appears: "Unable to open item for playback ()".
HLS link for testing:
Spoiler (click to show/hide)

Thanks!
Title: Re: External Tags
Post by: Case on 2018-10-20 17:57:44
Thanks for informing. Fixed. I also made tag edits refresh instantly (doesn't work with streams).
Title: Re: External Tags
Post by: Porcus on 2018-10-20 19:06:31
0.9.5 tested. "My" issue appears to be resolved.
Title: Re: External Tags
Post by: Sergey77 on 2018-10-20 19:20:00
Thanks for informing. Fixed. I also made tag edits refresh instantly (doesn't work with streams).
Yes, now that works fine!
@Case, Is it time to attach a picture for a stream link? :)
Title: Re: External Tags
Post by: Sergey77 on 2018-10-20 20:25:29
@Case, External Tags don't work for links of foo_youtube (https://fy.3dyd.com/download/) component.
for testing:
Spoiler (click to show/hide)
Please check it.
Title: Re: External Tags
Post by: sveakul on 2018-10-21 04:17:46
@Case, Is it time to attach a picture for a stream link? :)
What would be cool is to add a property like "link to specified image" in External Tags  where user could enter just the path to a specified image file for a radio stream which would then be displayed in the Album Art Viewer box as if it were an embedded cover image.  Case, is that a possibility?

Title: Re: External Tags
Post by: Case on 2018-10-21 10:25:22
New version posted. The component now listens for file deletion and moving callbacks and automatically moves and deletes external tags as needed.

And I added a wrapper method that allows forcing streams to go through the component so you can add album art. You can manually add url wrapped inside "exttag://(url here)" string or turn existing playlist entries to the wrapped format from the right click context menu.

Next plan for the component is to add an optional sqlite database for holding the tags.
Title: Re: External Tags
Post by: Sergey77 on 2018-10-21 13:21:42
@Case,
first of all I'm very happy that you managed to do the clever way ...exttag: // () wrapper...
I got identical view of the stream items at the playlist for External Tags and m-TAGS.
But during playback, the behavior of these items is different at playlist. For items of External Tags the contents $meta(genre), $info(tagtype), $meta(url) are missing (see pic. ETG).
For items of m-TAGS all the contents is visible during playback (see pic. MTG), that looks better. Also has the different look for %title%.
Is it possible to get for the elements of External Tags of the same view at playlist as for the elements of m-TAGS during playback?
One more question: m-TAGS can not attach the picture for the same link when the External Tags has already attached the picture?
(I get an error: "Attached picture editing failure on "D:\RadioPlaylist\Intense Radio.tags": Access denied"

p/s
Thanks for your persistence, diligence and work!
Title: Re: External Tags
Post by: Sergey77 on 2018-10-21 14:02:38
@Case, External Tags don't work for links of foo_youtube (https://fy.3dyd.com/download/) component.
for testing:
Spoiler (click to show/hide)
Please check it.
That fixed. Thanks again!
Title: Re: External Tags
Post by: Case on 2018-10-21 15:50:29
But during playback, the behavior of these items is different at playlist. For items of External Tags the contents $meta(genre), $info(tagtype), $meta(url) are missing

External Tags returns what the decoder returns. That's the same output you'd get from unwrapped stream. But I changed that for the next version.

One more question: m-TAGS can not attach the picture for the same link when the External Tags has already attached the picture?
(I get an error: "Attached picture editing failure on "D:\RadioPlaylist\Intense Radio.tags": Access denied"
You're sure you aren't attempting to use m-TAGS to work on a link wrapped behind the exttag:// protocol? My component shouldn't affect .tags files in any way.
Title: Re: External Tags
Post by: Sergey77 on 2018-10-21 16:49:49
I checked again, you were right. That m-TAGS does not allow to attach a picture to the link with the end .flac, but your component allows.
Everything works great!
@Case, please also consider the possibility to use the feature "Linked meta (field for inline editing)" in CUI for editing TAG fields directly from the playlist for External Tags.

Thanks!
Title: Re: External Tags
Post by: sveakul on 2018-10-21 17:55:35
Sergey77:  have you tried using the new wrapper to attach an image to a stream that isn't on a web url path, but on an internal path to an image file on your computer?  Is that working for you?  If so, what are you entering?  Thanks for any help!
Title: Re: External Tags
Post by: Sergey77 on 2018-10-21 18:27:01
sveakul: I attach local images to links that are on my computer.
When using External Tags, the steps is follows:
1. add a stream link to the playlist
2. right click on the link/Tagging/Wrap for External Tags (set in Context Menu)
3. right click on the link/Tagging/Edit External Tags
4. right click on the link/Tagging/Attach pictures/Front cover (when the warning window appears - click ok)
and choose a picture for the link. The picture will be displayed at field Artwork view.
Title: Re: External Tags
Post by: sveakul on 2018-10-21 20:09:37
Thanks Sergey77, this works!  I noticed that the new tag created in the "external-tags" folder after doing so grows in size to about the same as the picture attached, so I assume the picture itself is actually put inside the new "wrapped" tag, like embedding into an audio file.  I was hoping that instead it would just contain the LINK to the picture's location and Foobar could use that path to display it in the view box, but hey I'm good with this too  ;D

Case:  Possible bug noticed:  After a new wrapped tag has been created from an existing stream that had a "regular" external tag, using the context command "Remove External Tags" deletes the tag from the external-tags folder, but the stream's "properties" still show "Tag Type" as "External Apev2", and the filepath/folder name still have the prefix "exttag://" after refreshing the entry.  Can these be removed also from wherever  that info is being stored?
Title: Re: External Tags
Post by: Case on 2018-10-22 16:33:02
Good idea to remove the wrapping when external tag gets deleted. I'll add that.

About your album art link question, there are already multiple ways to achieve that. You could for example add a tag COVER where you write the name of the image you want to use. Then configure foobar2000 to look for images from that tag field under Preferences -> Display -> Album art. For example if you store cover images in C:\Covers you could add C:\Covers\%COVER% to the list.
Title: Re: External Tags
Post by: sveakul on 2018-10-22 19:39:23
Case:  first, thank you for planning on deleting the wrapper when the external tag is deleted, that will make it much easier to visually see what actually still has an External Tag from the properties window.

Second, WOW, your instructions on how to do a stream image display from a link instead of embedding in a wrapper works great!!  It even works fine without having to add a wrapper first.  Much appreciated!  For others who would like to see the steps I did:

1.  In Foobar's Prefs/Display/Album Art/Front cover, type the path to the folder you have images in (can be ANY folder path) into the Search patterns box followed by %COVER%, for example "E:\Media\%COVER%" (no quotes), and save.

2.  Select a stream from your playlist and, if it doesn't already have one, add an External Tag via right-click-->Edit External Tags;  you do NOT have to add a wrapper first.

3.  In the resulting Properties window, hit the "Tools" button on the lower left, and choose "add new field"

4.  Make a new field named COVER in "Field name", and in the "Field value" box, type in the file name of the image you want to display for that link that exists in the folder you specified in step #1 (E:\Media), like "blue ocean.jpg" (minus the quotes), and hit OK.

5.  Now refresh the link by double-clicking on another link, then double-clicking the modified link;  VOLIA, the picture you chose is displayed!  Sometimes it seems to need a second refresh to "take."

The above is tested for radio streams.  The think I like about this method vs. the wrapper embed is that it's fast and easy to change the image and you don't need to add that file size to the external tag itself.  Thanks again, Case, for your instructions!
Title: Re: External Tags
Post by: Case on 2018-10-22 19:53:03
I posted a quick update for the component a moment ago that includes the streaming changes. There's still apparently some potential weirdness possible with local subsong-enabled formats so other updates are on hold until I get those sorted.
Title: Re: External Tags
Post by: Sergey77 on 2018-10-23 15:23:19
Case: the component merge static metadata to dynamic metadata works great! Thank you!
sveakul, :)
I used your instruction and I also managed to attach a picture to the link. I liked this way too. Thanks!
Although the wrapping method is also good!
Now I'm "converting" my collection of Internet radio and HLS streams by use External Tags component. :)
Title: Re: External Tags
Post by: Anakunda on 2018-10-28 22:37:15
Can you please make a choice to store external tags in one file per folder, e.g. folder.tags. The bunch of small files makes me nervous and makes the folder messy.

Also how does work Store tags in Alternate Data Streams instead of .tag files? Not working for me.
Title: Re: External Tags
Post by: kode54 on 2018-10-29 00:31:31
Alternate data streams are not guaranteed to work on network shares unless you specially configure your Samba share server to support alternate data streams, otherwise there won't be any way to store them. On local file systems, they're only guaranteed to work on NTFS and ReFS, or maybe whatever you're running Wine on, assuming it supports that crap.
Title: Re: External Tags
Post by: Anakunda on 2018-10-29 06:58:54
That's NTFS drive directly connected, alternate data streams doesn't store anything.
Title: Re: External Tags
Post by: kode54 on 2018-10-29 07:08:40
Also note that Alternate data streams are not really visible in most file managers, but if it's not working at all, then it does sound like it's broken.
Title: Re: External Tags
Post by: Case on 2018-10-29 07:39:26
The component won't convert existing .tag files into streams. Remove existing .tag files and try creating external tags again. It will revert to .tag on unsupported file systems or other error situations.
Title: Re: External Tags
Post by: Anakunda on 2018-10-29 11:47:30
@Case
So, the Alternate data streams in principle do work on NTFS filesystem.
Please add the detection if ADS can't be used and use consolidated folder.tags instead.
The external tags are now recognized quite steadily by foobar, except the conversion. For target naming scheme external tags are always used (if present). But, for transfer of tags from source → output, external tags are not always used. It's random mixture of original and external tags. Maybe bad timing?

A minor extra wish: please add a menu entry "Create external tags" which will (re)create extern tags from original metadata content, without opening the properties dialogue.
Title: Re: External Tags
Post by: Case on 2018-10-31 17:09:35
Is there some reason you hope for additional command that won't open properties dialog? Note that opening the dialog won't slow the process down at all, copying existing tags and forcing foobar2000 to reload info is what eats all the time. If you don't wish to alter the tags you can just close the dialog immediately. But if you wish to do some changes you can do them immediately.

Here's an experimental version of External Tags component which uses only SQLite databases and doesn't otherwise touch the filesystem. I also simplified the subsong handling to hopefully solve all the weirdnesses @Porcus had to deal with.
Currently it uses different file name and names for commands so it can co-exist with the original External Tags component. This allows copying tags from the old external tag files into the new database.

This database approach should be quite a bit faster when dealing with large amount of handled files. But let me know if you hate it so I'll know to discontinue.

Edit: experimental component removed. Official version now has SQLite support.
Title: Re: External Tags
Post by: Porcus on 2018-10-31 21:34:45
* It is a very good point that you actually do not need to do any editing in the Properties window - the external tags are created already and I can just hit Esc.
But the DB version opens "Properties" (with "Partial info shown") early on while still "Processing files", and I don't know whether it is safe to hit Esc then?!?

* Speaking for myself, I want to use external tags - your component or foo_tags, whatever I settle on - to reduce "write risk" not only for everyday tag updates, but also for updating a backup. (Whether I am comfortable with overwriting a .tag or whether I want versioning.) So writing .tag files from a DB is a more wanted feature than importing .tag tags to DB.


* Initial testing, first uninstallin foo_external_tags uninstalled and then reinstalling both:

- I can no longer reproduce the issues I had!

- After removing external tags (no-db), I - often - need to "Reload info from file(s) if changed" for those FLACs that have embedded cue and subsongs - except, the first subsong gets fixed automatically.  (So it says that it has external apes for e.g. 78 % of the tracks in a single file.) But "if changed" was sufficient in all cases but one (in which it was an ordinary multi-file folder too) - unlike the next:

- After removing external tags (DB), I need to "Reload info from file(s)" from precisely those files which have subsongs. The differences are (I): "Reload info from file(s) if changed" is insufficient on these files, and (II): the first subsong also "has" External Tag until reloaded.

- Both components leave fb2k "Not responding" while running "Edit", until the properties dialogue is open (which, as said, happens "quite early" for the DB component). fb2k still plays music, but does not accept any other user input.
The DB component leaves fb2k "Not responding" on Remove as well, the non-DB does not.
Title: Re: External Tags
Post by: Case on 2018-11-01 06:51:11
But the DB version opens "Properties" (with "Partial info shown") early on while still "Processing files", and I don't know whether it is safe to hit Esc then?!?
The "processing files" dialog is from info reload. It is performed after last external tag is done and properties dialog is given the open call.

The reloading wouldn't be 100% necessary but without it if tags aren't edited no components will see the new tagtype info field. And tagtype info field is actually used currently for deciding whether to show the Commit and Remove commands in the context menu. Though with DB version this could be changed to use the DB directly. It was originally this way to not slow context menu opening down from needless filesystem accesses.

writing .tag files from a DB is a more wanted feature than importing .tag tags to DB.
So that's a vote against the SQLite direction. I was hoping to simplify the component but it sounds like that can't be done. Filling Anakunda's wish of combined per-dir tag files will further complicate things.

- Both components leave fb2k "Not responding" while running "Edit", until the properties dialogue is open (which, as said, happens "quite early" for the DB component). fb2k still plays music, but does not accept any other user input.
The DB component leaves fb2k "Not responding" on Remove as well, the non-DB does not.
These operations run in the main thread. The file-using version apparently benefits from disk caches. The OS removes files on the background when it can, database keeps operations in sync. The operations can be moved to a thread to not lock the UI though.
Title: Re: External Tags
Post by: arch21 on 2018-11-05 06:53:59
I don't know if it was mentioned before, but when I tried to convert a track to Wave 64, an external tag was created automatically. Is it possible to have it always try to create an external track when doing convert without tagging?
Title: Re: External Tags
Post by: Case on 2018-11-05 08:21:17
That should already work. The original intention of the component is to function as a fallback for formats that don't support tagging. Since foobar2000 can't tag W64 itself the component handled it. If you wanted to create external tags even for formats that do support tagging it could be achieved by moving "External Tags (writer)" higher up in the decoder list in Preferences.
Title: Re: External Tags
Post by: Case on 2018-11-09 18:09:30
I uploaded a new version to my site (https://foobar.hyv.fi/?view=foo_external_tags). The component has too many changes for me to be certain I didn't break something so it's not on the official component repository yet.

There are now settings under advanced preferences to control use of APE tags, SQLite database or @Anakunda 's request of combined folder.tags file. By default only APE tags are used so it should behave like the original version.

Majority of old APE-tag code has been re-engineered to hopefully be faster and less buggy. I hope @Porcus can verify that multitrack files work properly now.

There were other bug fixes too, like a fix for foo_fileops crash (https://hydrogenaud.io/index.php/topic,116817.0.html) the component caused when encountering Access denied-error.
Title: Re: External Tags
Post by: Sergey77 on 2018-11-10 07:56:36
@Case, thank you for new version!
It seems that v 0.9.9 doesn't display $info(tagtype) for HLS links.
Please check it. Thanks!
Title: Re: External Tags
Post by: Case on 2018-11-10 10:13:47
Have you perhaps only added art to the stream without using "Edit External Tags"? The tag loader only checks external metadata presence which could explain the missing tagtype.
Title: Re: External Tags
Post by: Sergey77 on 2018-11-10 12:18:52
I checked the behavior of the two versions, while my actions are the same.
I'm not trying to add art to the stream. I just add the HLS link to the playlist, then apply "Edit External Tags".
v 0.9.8 displays the tag type for HLS. Here is the link for testing:
Spoiler (click to show/hide)
Title: Re: External Tags
Post by: Case on 2018-11-10 13:49:09
I see the tagtype can be missing if the external tag is left blank. That issue is solved for the next version. If it's missing even when there's tag data I'll need to do more testing.
Title: Re: External Tags
Post by: Sergey77 on 2018-11-10 14:13:24
If it's missing even when there's tag data I'll need to do more testing.
I see the tag type when there's data in tag.
Title: Re: External Tags
Post by: Anakunda on 2018-11-11 10:16:37
This 0.9.9 version somehow doesn't work as expected. Regardless of which of Prefer folder/APE tags, write stream tags to SQLite, read all three tag types/Use only folder tags is selected, the Edit external tags doesn't create the external container nor any further metadata change is applied.
The last plugin from fb2k components repo did work almost as I wanted (except support for folder tags as backup option if file streams aren't avail).
Title: Re: External Tags
Post by: Case on 2018-11-11 11:33:01
The prefer options will use the preferred tag-writing method when creating new external tags for a file. If something else already exists it will be used. When using one of the "only" methods then only the chosen option will be used for both reading and writing.
Title: Re: External Tags
Post by: Case on 2018-11-11 11:47:20
Version 1.0 released. Fixed inability to save empty tags in APE and folder tags, fixed ReplayGain writing to folder tags, added album art support for folder tags and ability to change the folder.tags filename.
Title: Re: External Tags
Post by: Anakunda on 2018-11-11 13:16:03
Version 1.0 released. added album art support for folder tags
Trying version 1.0, I'd say almost perfect. All issues from 0.9.9 seem be gone, this new feature doesn't work -> folder.tags exist -> Tagging, Attach pictures -> albumart is physically written to audio files

Yet I ask for explanation how exactly does "Wrap to External tags" work.
Title: Re: External Tags
Post by: Case on 2018-11-11 13:43:45
The wrapping changes the file or stream links to force them to be handled by the component.

Without wrapping if you try to add cover art to a format that has working tagging the built-in art handlers see the supported file extension and External Tags will never be called. And if you try to add art to a stream the request is silently ignored.

Wrapping works around these problems by hiding the original file extension and protocol for the playlist entry. Link file://c:\path\to\music.ext is turned into exttag://(file://c:\path\to\music.ext).
Title: Re: External Tags
Post by: Porcus on 2018-11-11 23:39:25
The good:
I can no longer reproduce any multi-track file issue.  Tried both per-file tagfiles and per-folder tagfiles.

The not so good:
fb2k seems not to recognize all the external tags when I choose "folder". It leaves a few files in every few folders as a hit when I search by "%__tagtype% MISSING" or by "NOT %__tagtype% HAS External". Doing that search:
- some disappear if I ask fb2k to "Reload info from file(s) if changed".
- Of the remaining: some disappear if I repeat that.
- All the remaining disappear if I "Reload info from file(s)".
However, it did happen on at least one occasion that some reappeared after restarting fb2k and searching again; not instantly, but gradually while it was updating the library. (I have enabled both Rescan on startup and Monitoring.)

Running: beta 6.
Title: Re: External Tags
Post by: Case on 2018-11-12 13:32:47
Thanks for testing. Bug in loading optimization sometimes thought tag for a directory was loaded when it wasn't. Should be fixed in just released 1.0.1.
Title: Re: External Tags
Post by: Sergey77 on 2018-11-12 15:47:35
If you apply “Attach pictures” after “Edit External Tags” for the HLS stream, the tag type will be missing again (only if the external tag is left blank).
Title: Re: External Tags
Post by: Case on 2018-11-12 16:25:30
Fixed in 1.0.2.
Title: Re: External Tags
Post by: sveakul on 2018-11-12 20:24:23
Case, thank you for 1.03 just installed!  And thanks for maintaining the options for all users to continue using External Tags according to their own needs, however modest (as in my APE-only use).  Some developers end up losing the base functionality in an attempt to offer more advanced user options;  you maintain both :)
Title: Re: External Tags
Post by: Sergey77 on 2018-11-13 06:47:23
^ I join to the said.
Case,
please, take a look at the following: after applying the "Wrap for External Tags", the foo_yutube component stops opening the video (for HLS, YouTube links) only the sound is played. Thanks!
Title: Re: External Tags
Post by: Case on 2018-11-13 07:18:36
The YouTube component must have some checks to only activate video playback for normal playlist entries. It's better to keep those unwrapped.
Title: Re: External Tags
Post by: Sergey77 on 2018-11-13 07:41:18
The YouTube component must have some checks to only activate video playback for normal playlist entries. It's better to keep those unwrapped.
Ok, quite acceptable to me. I will use as sveakul written Reply #87 (https://hydrogenaud.io/index.php/topic,116141.msg963903.html#msg963903) for the foo_youtube component.
Title: Re: External Tags
Post by: Anakunda on 2018-11-13 21:21:50
A bug found on ET 1.0.3:
Applying external tags on CUEsheet + image randomizes the tracks order in playlist, otherwise in properties are sorted.
Title: Re: External Tags
Post by: Case on 2018-11-14 06:20:13
By "applying" do you mean creating external tags or the commit function that writes the external tags back to the tracks?
I can't imagine either doing anything like that unless you use auto-sorted playlists and the names change. Creating external tags doesn't touch playlist, committing will alter playlist in case externally tagged file was wrapped behind exttag:// protocol. The wrapping is removed and file is placed in the playlist at the same position the original file was at.
Title: Re: External Tags
Post by: Anakunda on 2018-11-14 06:29:08
Applying = Creating, and I don't use any auto-sorting.
The tracks order has changed and can't say if only visually or physically touching the playlist order.
Title: Re: External Tags
Post by: Case on 2018-11-14 07:03:15
Can you replicate the weirdness you see? foobar2000 doesn't alter track orders on normal playlists and the component doesn't have any playlist code for external tag creation. I suspect something else is going on.
Title: Re: External Tags
Post by: Case on 2018-11-14 10:06:52
Could it be you got confused about what order is mixed? To support the new folder-based tagging I call foobar's sort function to sort selection by path so that consecutive tracks will use the same folder.tags file for maximum speed. With image+cue that will alter the metadata order it shows in properties but it doesn't affect the actual order in playlist.
Title: Re: External Tags
Post by: Case on 2018-11-14 11:09:01
Released a new version with changed sorting so Properties dialog displays the tracks in subsong order. Also fixed bug preventing committing tags to files with multiple subsongs.
Title: Re: External Tags
Post by: sveakul on 2018-11-18 03:44:20
It seems that 1.07 has a regression:  the version info for 1.05 states "Editing external tags no longer needs to reload info from the tracks;"  however, with version 1.07 selecting a radio stream that already has an APEv2 external tag and choosing "Edit external tags" will cause a reload info operation every time before displaying the properties window.  On the same stream, just choosing "Properties" will not reload info on its own.  May have started with 1.06, but only noticed until now after going to 1.07.
Title: Re: External Tags
Post by: Case on 2018-11-18 10:13:58
The change log entry refers to a different behavior. The component used to call the "Tagging" -> "Reload info from file(s)" context command on the tracks after writing the external tags. That operation was annoying when tagging thousands of files as it could be rather slow with regular mechanical hard drives. That reload requirement was eliminated by informing the player about new tagtype with other means.

I actually tried to make stream tagging faster in newer versions by changing get_full_info_ref() function to just get_info_ref() for streams. The first one will reload info from files if it's not all cached and the latter shouldn't. But it seems accessing stream infos is still slow.
Title: Re: External Tags
Post by: sveakul on 2018-11-18 17:53:46
Thanks Case for the explanation.  As I understand it then, the changelog entry meant that the reload info call was just eliminated in cases of initially creating the external tag, not when going back to it later to change/add data and using the "Edit External Tags" menu selection.

This leads  me to a related question.  So when editing an already created APEv2 external tag for a stream, is there any difference/preference in doing so via the "Edit External Tags" choice which first does a reload info prior to bringing up Properties, or by just selecting "Properties" right off?  Is the first choice really only needed when the tag is being initially created?
Title: Re: External Tags
Post by: Case on 2018-11-18 20:09:48
For local files there's no difference once a file has external tag and decoder priorities are set correctly. For streams there is. Unless the stream link is wrapped opening normal properties dialog won't call any tag saving routines. All edits will just be ignored.
Title: Re: External Tags
Post by: sveakul on 2018-11-18 21:48:45
Thank you that is good information to know that I was unaware of.  Unwrapped stream (as all of mine currently are), use Edit External Tags; wrapped stream, just Properties.
Title: Re: External Tags
Post by: Anakunda on 2018-11-19 08:59:16
I'm testing ET 1.0.7 now and the previously reported bug is gone. However not fully stable yet, external tags from CUE playlist not all transfer to output files on conversion (all ext. tags are used for filename scheme during conversion). Just the metadata transfer fails case by case.
Title: Re: External Tags
Post by: Case on 2018-11-19 19:05:30
I had to rewrite the wrapping logic to fix that but frankly it was stupidly implemented earlier. CUE inputs should now work with Converter. The rewrite also allowed me to remove old HLS stream related hack I had in place.
Title: Re: External Tags
Post by: Sergey77 on 2018-11-20 13:38:23
Case, maybe the wrapping function should be available only after applying the "Edit External Tags" ?
Otherwise, if you applied the wrapping before, then how to unwrap it back !? Only through the use of "Edit External Tags", and then "Remove External Tags".
Title: Re: External Tags
Post by: Case on 2018-11-29 20:27:00
There were probably some reasons early on to have wrapping always available, but I see no need for that anymore either.
Title: Re: External Tags
Post by: Nisto on 2018-12-03 21:49:59
There appears to be a serious problem in the latest version of External Tags (v1.0.9). After tagging a set of files, the tags of the last file in the current playlist are repeated for anything subsequently added to it.

I'm using the default settings of External Tags on a clean portable installation of foobar2000 v1.4.1, with the decoders at the top of the priority list (writer first, reader second).  Reproduction steps:

1. Make sure you have the External Tags writer at the top of the decoder list, and the reader in second place
2. Make sure External Tags settings are default (Use only APE tags, "Store APE tags in Alternate Data Streams [...]" off)
3. Load a set of audio files into a blank playlist
4. Select the files in the playlist, right-click them and go into Properties
5. Assign a new tag to them
6. Add a new set of files to the playlist

The tracks you add in step 6 will all have the same tags as that of the last item loaded in step 3.


While I'm here, can I ask how "use only APE tags" works? I.e., what does it use to identify a file/track? Does it use common tags like artist/album/title? I looked in the .tag file in the foobar2000 configuration folder, but couldn't see any path references or other possible identifiers.

Also, can we have back individual file tags, instead of only folder tags?
Title: Re: External Tags
Post by: Porcus on 2018-12-03 22:55:34
@Nisto : Have you tried to select, Shift+right-click, Tagging, "Reload info from file(s)"? Still it seems I sometimes have to do that.

Also, can we have back individual file tags, instead of only folder tags?

Under fb2k's Preferences > Advanced > Tagging > External tags, select an "APE tags" option rather than "folder tags".
Title: Re: External Tags
Post by: Nisto on 2018-12-03 23:11:15
@Nisto : Have you tried to select, Shift+right-click, Tagging, "Reload info from file(s)"? Still it seems I sometimes have to do that.

Also, can we have back individual file tags, instead of only folder tags?

Under fb2k's Preferences > Advanced > Tagging > External tags, select an "APE tags" option rather than "folder tags".


Yeah, tried it. That doesn't help.

If I use an "APE tags" option (at least "Use only APE tags"), the component seems to only write a single .tag file in a folder called "external-tags" inside the foobar2000 configuration folder. What I want is for it to write a respective .tag file for each audio file, like you could in earlier versions of External Tags. That makes it easier to rename folders, copy files around, etc. without losing associated tags.
Title: Re: External Tags
Post by: Case on 2018-12-04 06:37:53
Sorry, seems I accidentally broke the original intented behavior. You can circumvent the problem by using the Tagging -> Edit external tags context command instead of Properties for now.
Title: Re: External Tags
Post by: Case on 2018-12-04 20:06:14
Fixed version uploaded.
Title: Re: External Tags
Post by: Nisto on 2018-12-04 21:42:38
It works! Thanks for the update.
Title: Re: External Tags
Post by: Nisto on 2018-12-06 14:25:39
Another small bug (for APE tags at least): with files that has subsongs, when you remove tags from a selected set of files, only the tags in the first selected item are removed. Same when adding/editing tags.

Also, hate to be nitpicking, but I notice External Tags writes an "external-tags.db" file in the fb2k configuration folder even when not using SQLite. Any way to avoid this?
Title: Re: External Tags
Post by: Case on 2018-12-06 16:50:29
Hopefully fixed.
Title: Re: External Tags
Post by: Nisto on 2018-12-06 17:29:26
Hmm. It seems to have fixed adding/editing tags, but removing still only removes the tags from the top item in a selection (both when I go to Tools -> Remove tags in the Properties window, and when I manually select all the tags and remove them via Delete key or context menu).

The tag data being written when removing all tags doesn't contain any subsong references. Maybe it has something to do with that?
Title: Re: External Tags
Post by: Case on 2018-12-06 18:29:09
I misunderstood what you meant by tag removal. I thought you were removing external tags. Wiping old tag contents means External Tags needs to write a tag with no contents. That works for me when I select everything in Properties and hit delete.
Title: Re: External Tags
Post by: Nisto on 2018-12-06 22:23:21
Case, what formats are you working with, that has subsongs? Here's what happens with GBS files for me:
Title: Re: External Tags
Post by: Case on 2018-12-07 20:32:08
I was testing with FLAC and my file had ReplayGain info, which doesn't get removed the way I wiped the tags. A version that allows writing blank subsong info into APE tags is now out.

Hitting the Remove tags button worked as you expect with gbs files which don't support native tagging, but when I hit it with an MP3 file foobar bypassed the External Tags and actually removed the tags from the MP3 file. So be careful.
Title: Re: External Tags
Post by: Sergey77 on 2018-12-08 05:09:03
Seem the component doesn't work properly for the following webradio links:
Code: [Select]
http://secure.live-streams.nl/flac.flac
http://radio-paralax.de:8000/;9623928300546054stream.nsv
http://relay-chi.gameowls.com/all.ogg?1:iXuQ4MxIpy
https://radio.kamchatkalive.ru:8103/chillout
Check, please. Thanks.
Title: Re: External Tags
Post by: sveakul on 2018-12-08 05:50:32
Hi Sergey77:  what exactly isn't working properly for you with those links?  I have an external tag on the Intense Radio FLAC link which works fine, but I made it several versions ago, not with 1.0.12--do the problems start with that version?  I just updated to it and don't want to start using it if it has an issue as I have many external tags for streams (all APEv2 only).  BTW I don't have an external tag on Radio Kamchatka Live Chillout but that's my favorite chillout stream, you have good taste :)
Title: Re: External Tags
Post by: Sergey77 on 2018-12-08 07:05:22
Hi! sveakul, thanks! :)
For all these 4 links, the "ExternalAPEv2" tag type is not saved after the start of playback. I think this behavior occurred earlier than version 1.0.12.
Does this link work fine for you? http://secure.live-streams.nl/flac.flac
For some reason my playback is interrupted for that link.
Title: Re: External Tags
Post by: Case on 2018-12-08 12:55:30
Those streams were broken with the decoder handling change I made to fix Converter metadata issue Anakunda noticed. The decoder is now chosen purely on file path and mime-type is ignored. I added mime-type support but something is still wrong, opening the FLAC stream takes way too long. I don't want to release an update until I know how to fix that.
Title: Re: External Tags
Post by: sveakul on 2018-12-08 18:03:16
Hi! sveakul, thanks! :)
For all these 4 links, the "ExternalAPEv2" tag type is not saved after the start of playback. I think this behavior occurred earlier than version 1.0.12.
Does this link work fine for you? http://secure.live-streams.nl/flac.flac
For some reason my playback is interrupted for that link.

Damn, I updated to 1.0.12 and now I have the same issues as you do!  Has to be because of the change Case mentioned in External Tags not looking at mime data for streams anymore.  Well now he's aware of it (thanks to you!) and we can wait for hopefully a quick fix.  Can't play several of my tagged streams now.  From what Case said it seems 1.0.7 was the last "safe" version for this but I don't think there is an "older versions" area it could be downloaded from in the meantime.
Title: Re: External Tags
Post by: Case on 2018-12-08 19:35:21
I released an update that adds the mime-type based decoder selection. It worked fast when I tested it but now it again seems to suffer from slowdowns with the linked FLAC stream.
Title: Re: External Tags
Post by: Nisto on 2018-12-08 19:35:57
Case: never got around to trying v1.0.12 (I'm a bit late, sorry), but v1.0.13 crashes as soon as I load a GBS file, so I can't confirm if the subsong tagging issue has been resolved.
Title: Re: External Tags
Post by: Case on 2018-12-08 19:46:03
Fixed.
Title: Re: External Tags
Post by: sveakul on 2018-12-08 20:24:35
Hi Case:  I updated to 1.0.14, but some streams still remain stuck in "Starting playback...", for example the stream Sergey77 reported (http://secure.live-streams.nl/flac.flac (http://secure.live-streams.nl/flac.flac)) , and also this one: http://rondo.iradio.fi:8000/klasu.flac (http://rondo.iradio.fi:8000/klasu.flac) .

Others seem only to intermittently have the problem, like http://89.223.45.5:8000/space-160 (http://89.223.45.5:8000/space-160) .

I was able to find a backup copy of Foobar I had made when using External Tags 1.0.7, and all streams work perfectly there doing an A/B between the ones with problems on 1.0.14.  A backup made using 1.0.10 also has the problems.
Title: Re: External Tags
Post by: Case on 2018-12-09 07:37:06
I could no longer replicate the slow opening of the FLAC stream or the links you provided with v1.0.14.

Could you test if the attached version works correctly for you. I changed the decoder search to try all decoders based on mime-type first before letting anything see the path.

Edit: Attachment removed as obsolete.
Title: Re: External Tags
Post by: Sergey77 on 2018-12-09 07:58:19
Noticed for v1.0.14.1:
1. When the External Tags (reader) is enabled, the behavior for these different (vorbis, FLAC) links is following:
Spoiler (click to show/hide)
2. With decoder (External Tags (reader)) is enable, clip search with internal function by foo_youtube "Search (Integrated)" -  is slow down.
3. It seems the component affects the operation of the foo_youtube. Symptoms are as follows: immediately after installing the External Tags - the foo_youtube component works well, but then the HLS video and YouTube clips stop working. I still do not understand what affects this behavior.
Title: Re: External Tags
Post by: Case on 2018-12-09 09:58:10
I updated the previous attachment. There should no longer be slowdowns for streams with no tags.
Title: Re: External Tags
Post by: Sergey77 on 2018-12-09 11:27:36
@Case, the component works perfectly for me now!
Thanks for the update!
Title: Re: External Tags
Post by: Case on 2018-12-09 13:02:58
Hopefully everything works well with Nisto's use case too. The test version from the attachment is now released properly.
Title: Re: External Tags
Post by: sveakul on 2018-12-09 17:48:51
Case:  just tried 1.0.15, all the streams I had a problem with now open normally, thanks a lot for the fix!
Title: Re: External Tags
Post by: Nisto on 2018-12-09 22:46:15
Case: Hey, sorry for the late feedback again. It works now.

EDIT: Sorry to be a PITA once again, but there is one more small problem I've noticed. When you go to the "Edit External Tags" context menu, it immediately creates external tags if they don't exist. But if you cancel out of the Properties window, the external tags remain. I think it would be better if the edit menu was disabled if there are no external tags, and have an explicit "create external tags" menu instead. And maybe in advanced settings, you could have an option for whether or not to copy tags from the source file when creating external tags.
Title: Re: External Tags
Post by: Porcus on 2018-12-09 22:48:29
Updated. Again, making the search
NOT %__tagtype% HAS xterna
makes a few lonely files (no more than one from each album) show up. But this time, all disappeared with "Reload info from file(s) if changed", no need for "Reload info from file(s)".
Title: Re: External Tags
Post by: sveakul on 2018-12-10 03:33:35
EDIT: Sorry to be a PITA once again, but there is one more small problem I've noticed. When you go to the "Edit External Tags" context menu, it immediately creates external tags if they don't exist. But if you cancel out of the Properties window, the external tags remain. I think it would be better if the edit menu was disabled if there are no external tags, and have an explicit "create external tags" menu instead

+1 for me on this also;  I mentioned the same in a previous post:  https://hydrogenaud.io/index.php/topic,116141.msg960392.html#msg960392 (https://hydrogenaud.io/index.php/topic,116141.msg960392.html#msg960392)

..and thanks for putting up with us PITA's!!

Title: Re: External Tags
Post by: Sergey77 on 2018-12-10 13:07:52
Hi!
Case: please, look the crash report in attachment. Thanks.
Title: Re: External Tags
Post by: Case on 2018-12-10 14:54:15
I think it would be better if the edit menu was disabled if there are no external tags, and have an explicit "create external tags" menu instead.
What benefit would the wording difference give? Or do you mean creation would not open properties so you'd have to open properties separately if you wanted to make changes?

Case: please, look the crash report in attachment. Thanks.
I can't do anything with this as it doesn't show any stack trace or call path where external tags is involved. But I saw some crashes in the crash logger for which I can download memory dumps.
Title: Re: External Tags
Post by: Sergey77 on 2018-12-10 15:06:33
But I saw some crashes in the crash logger for which I can download memory dumps.
Ok I can send that.
Title: Re: External Tags
Post by: Nisto on 2018-12-10 15:15:33
I think it would be better if the edit menu was disabled if there are no external tags, and have an explicit "create external tags" menu instead.
What benefit would the wording difference give? Or do you mean creation would not open properties so you'd have to open properties separately if you wanted to make changes?

The real issue here is that external tags aren't removed when you cancel out of the Properties window. If you unintentionally hit "create external tags" by accident, then you know you need to remove them first in order to get to the source tags, but currently, the behavior is kind of implicit, so you wouldn't know you were editing External Tags if you subsequently went into a regular Properties window. Sometimes you may actually want to modify the source tags even if External Tags exist, but there currently is no way to do so. As an alternative, maybe you could add an explicit "edit file tags" menu? That would be really sweet, actually. The idea is to primarily edit external tags if they exist, but the source tags should still be editable by some means.
Title: Re: External Tags
Post by: sveakul on 2018-12-10 19:47:52
I think it would be better if the edit menu was disabled if there are no external tags, and have an explicit "create external tags" menu instead.
What benefit would the wording difference give? Or do you mean creation would not open properties so you'd have to open properties separately if you wanted to make changes?

My take on this would be that if a file or stream currently has no external tag, the context menu should show "Create External Tag" as an option for those entries, and open the Properties window for editing the new external tag.  If an external tag does already exists, then the context menu choice for those files/streams would only show the "Edit External Tags" choice (and Remove of course) when changes need to be made, which would also open the Properties window.
Title: Re: External Tags
Post by: Case on 2018-12-10 20:09:19
People suffering from crashes with 1.0.15 should update to latest version. It will no longer attempt to access the decoder after it's gone. Curious that the crash logger only has entries for this issue with 1.0.15 even though the problem has always been there.

Here's a test version for Nisto that won't tag anything with Edit tags feature unless one edits tags. There is no automatic refresh for the changed info as foobar2000 doesn't see them automatically. Not sure it can be added.

And there's additional context menu command to force-bypass External Tags and edit file tags directly.

Edit: attachment removed.
Title: Re: External Tags
Post by: Nisto on 2018-12-10 21:14:40
@Case: Really unfortunate about the inability to automatically refresh the displayed tags. It worked in earlier versions - what has changed? Are you required to pre-create the external tags for it to work?

There seems to be some bugs. In my case, simply opening "edit file tags" and doing a "remove tags" on a FLAC file won't save the changes (I've looked at the actual file outside of foobar2000; it still has the same timestamp and binary data). Also, adding a new tag will remove all the tag data - yikes!
Title: Re: External Tags
Post by: Case on 2018-12-11 18:20:00
Second test version with above issues fixed and with automatic refresh after external tag edition.

Context menu was changed around a bit and now only "Edit External Tags" and "Edit file tags" are visible by default.

There's also explicit "Create External Tags" command that works like old edit command, but it's only available if selection has files that don't have external tags yet (or if over 100 tracks are selected in which case all context display rule checks are bypassed not to delay the menu opening).

Edit: attachment removed - new version with the changes has been released.
Title: Re: External Tags
Post by: Nisto on 2018-12-11 19:01:37
I'm okay with the new behavior. Thanks for all the hard work, Case!

Just one small thing so far: the "remove external tags" menu is missing.

Also, being that the "old method" now doesn't actually create external tags immediately upon entering the Properties window (it does so when actually Apply'ing or OK'ing), AND it automatically refreshes tags, I would be okay with you using whatever that programmatic approach is in all cases. I was expecting that, if I wrote external tags to >100 files, it would not automatically refresh the tags, or that it would immediately create external tags when the Properties window appeared - but evidently that isn't the case, which is great. Really, I don't even see a difference between the two methods.
EDIT: Okay, so you mention a "create" menu, but.. that doesn't show for me when selecting >100 files. Not even >1000 files. There's still only an "edit" menu.
EDIT 2: Sorry! Found it in the shift-context-menu.
Title: Re: External Tags
Post by: Case on 2018-12-11 19:35:10
The remove command is there, hidden by default like before. If you had manually made it visible in Preferences it might have changed as its index is different now. All the commands are visible when opening the context menu while pressing Shift-key.

The Edit command in the test version is different from the Create command as Edit does nothing unless you actually change something. Properties dialog won't retag files if there's nothing to do.
Title: Re: External Tags
Post by: sveakul on 2018-12-11 20:11:31
1.0.16.2 working great here;  appreciate the changes you made as to how the context menu is handled for streams with/without tags, thanks Case!  This thing is a real piece of work.
Title: Re: External Tags
Post by: Nisto on 2018-12-11 20:55:57
One last thing (I hope! God I'm annoying): would it be possible to show the "edit file tags" menu regardless of whether or not external tags exist? Mostly for the consistency.
Title: Re: External Tags
Post by: Porcus on 2018-12-12 11:46:17
Bug:
folder.tags not updated when fb2k renames files.

Version 1.0.16 from the repository. (This behaviour encountered in earlier versions as well.)
Title: Re: External Tags
Post by: Case on 2018-12-12 19:22:55
Porcus, I saw a problem when directory name changes as the path in the callback no longer had tag data. When only filename was renamed I saw no issues. Path change scenario is now handled in the new test version and I added automatic refresh for the metadata for rename cases too.

Nisto: that request makes sense. Implemented that too in the new test version.

Edit: attachment removed - new version with the changes has been released.
Title: Re: External Tags
Post by: Porcus on 2018-12-13 10:51:15
when directory name changes

Oops, I did not think over that: yes I might have used Move and changed directory name. What I did when I discovered it, was to open folder.tags in Notepad++ and find that the old filenames (but not the new) were still referenced. But of course, as Move moves other files, including folder tags ...

(Speaking of which: would it break major functionality to insert linebreaks and have one line per track in folder.tags?)
Title: Re: External Tags
Post by: Case on 2018-12-13 12:07:42
(Speaking of which: would it break major functionality to insert linebreaks and have one line per track in folder.tags?)
It's binary data and the tag reader parses the file based on lengths stored before each string. If extra characters are added the parser will see wrong lengths and will stop parsing as soon as the data doesn't match expectations. If field lengths are fixed to account for the extra newline character(s) they will be read into a tag value by old component.

I wouldn't want to break compatibility especially as I'd also have to support reading the current format.
Title: Re: External Tags
Post by: Sergey77 on 2018-12-13 13:32:25
removed
Title: Re: External Tags
Post by: Sergey77 on 2018-12-13 14:35:36
Hi!
Case: I noticed that the component v1.0.16 (It is not typical for v1.0.16.2(3)) does affect the video playback on HLS links (foo_youtube). When the decoder (reader) is on, some links stop playing (an error appears), or the video playback slows down.
For testing, I am attaching the HLS link: http://bcliveuniv-lh.akamaihd.net/i/iptv1_1@194050/master.m3u8
When the decoder is turned off, video playback is performed normally.
Title: Re: External Tags
Post by: Case on 2018-12-13 16:00:28
I don't see external tags being involved at all. Process Explorer's thread view shows pretty much only foo_input_ffmpeg and foo_youtube running. Also I don't have video working reliably even with foo_external_tags uninstalled.
Title: Re: External Tags
Post by: Sergey77 on 2018-12-13 16:25:04
Perhaps agree. The behavior of HLS links is unstable and possibly independent of the component. Still testing and still not established dependency.
Title: Re: External Tags
Post by: Nisto on 2018-12-13 23:14:33
Nisto: that request makes sense. Implemented that too in the new test version.

The "edit file tags" menu is only available if >100 files are selected (or if external tags already exists). Could you fix this?
Title: Re: External Tags
Post by: sveakul on 2018-12-14 00:23:54
The "edit file tags" menu is only available if >100 files are selected (or if external tags already exists). Could you fix this?

That's strange, I'm using 1.0.16.3 and right-clicking a single file or single stream on a playlist does show "Edit file tags" as a submenu of Tagging;  this for files with or without an external tag.  Of course it is selected as a context menu display option in Preferences as I assume yours is also?

(https://i.imgur.com/J3LSTaN.jpg)
Title: Re: External Tags
Post by: Case on 2018-12-14 06:32:50
There is a bug indeed but not the way Nisto says. I have left the option always visible but I should disable it for streams and archives as those have no native tagging.

Edit: Nisto, are you sure you downloaded the right attachment? I didn't remove the old one this time and it sounds like you installed .2 instead of .3.
Title: Re: External Tags
Post by: Nisto on 2018-12-14 07:50:07
You're right, I somehow thought I had been using the attachment in post #178 for the past couple of days, and could've sworn I even downloaded that attachment more than once. But apparently not, because now it works. What the hell is wrong with me..

Sorry for the false alarm.
Title: Re: External Tags
Post by: Case on 2018-12-15 10:54:14
Test versions taken down as I released a new version with the changes. The file move issue Porcus reported with folder tags also affected APE tags so that was fixed too. Only other change from the third test version is that "Edit file tags" menu isn't shown when only selecting streams or archives.
Title: Re: External Tags
Post by: Porcus on 2018-12-15 11:21:41
Question: how is the component supposed to work with "/" in ID3 tags? ID3 was invented by someone who didn't know enough about music to think about AC/DC ...

Feature request - although I am a bit hesitant to post such, given the work you have to put into it:
Is there a way from within foobar2000 to check if the media file is more recently updated than the tags file - or has different tags? Reasons:
* Tagging with other applications. Picard, MP3Tag, CUETools ...
* General robustness towards errors or mistakes or "potentially unwanted" behaviour. (Inter alia, the "/"?)

 (btw, I fully understand the backwards compatibility concern, but with all this testing I have had so many .tags files open in Notepad++ for human reading ...)
Title: Re: External Tags
Post by: Case on 2018-12-15 12:52:03
Question: how is the component supposed to work with "/" in ID3 tags? ID3 was invented by someone who didn't know enough about music to think about AC/DC ...
I don't think I understand the question. Since the component doesn't parse tags itself but uses metadata provided by foobar2000 the slash is read as foobar2000 sees it. If foobar2000 interprets artist as AC/DC that's what external tag will contain. If it gets read as two fields AC and DC, external tag will include two artist fields.

Is there a way from within foobar2000 to check if the media file is more recently updated than the tags file - or has different tags?
How would such info be presented? I imagine it would need a new dialog showing the track and differences between the two tag sets. It wouldn't be pretty with my skills.
Title: Re: External Tags
Post by: Porcus on 2018-12-15 14:36:03
I don't think I understand the question.

I am not sure if I understand the issue either, which was the reason for the vague "how is ... supposed to ..." question.
I'll do some more testing.


How would such info be presented? I imagine it would need a new dialog showing the track and differences between the two tag sets. It wouldn't be pretty with my skills.
From an end-user point of view, a query for files-newer-than-tags would do - but I have no idea whether that is implementable at all.


Title: Re: External Tags
Post by: Case on 2018-12-15 15:56:47
Test version with a new context command for finding tracks edited since external tagging. If it finds such tracks it will create a new playlist and place the findings there.

Edit: Attachment removed.
Title: Re: External Tags
Post by: Porcus on 2018-12-15 18:30:45
OK, I found the "issue" with the "/", and it seems "independent of" External Tags: If I force MP3 files into ID3v2.3, it seems that Tom / Dick / Harry becomes a multivalue field. So if fb2k
- has Tom / Dick / Harry
- creates External Tags out of that
- commits to files
it does sometimes happen that it comes out as multivalue and reads Tom; Dick; Harry.

But, I provoked the same to happen by "Rewrite file tags" without invoking External Tags. @Peter , is this expected behaviour?


Test version with a new context command for finding tracks edited since external tagging. If it finds such tracks it will create a new playlist and place the findings there.

All testing for this post done with that. Seems to work.
Title: Re: External Tags
Post by: Porcus on 2018-12-15 19:53:23
Seems to work.
Meaning: new functionality seems to work, no change detected in old behaviour. Including the "/".

Edit: Although ... now it seems easier to make fb2k unresponsive? More things stuffed into the "main" thread or whatever it is called?
Title: Re: External Tags
Post by: Case on 2018-12-15 20:25:36
The new function runs in main thread for simplicity. If it's what you want and you find it useful I can move it to its own thread.
Title: Re: External Tags
Post by: Case on 2018-12-16 11:12:49
Version 1.0.18 up with the new search function moved to its own thread. Also fixed a bug with reading back ReplayGain info from non-subsong enabled external APE tags.
Title: Re: External Tags
Post by: Nisto on 2018-12-16 22:59:36
Okay, here's a problem: if you select a set of audio files where only one of them contains a certain tag and you remove it (via "Edit External Tags"), it will only create a .tag file for the one file that contained the tag. I would've preferred it created a .tag file for all files, even if there's technically no change for some.
Title: Re: External Tags
Post by: Case on 2018-12-17 05:47:23
That's how properties dialog works. It doesn't call tagging functions unless something actually changes. I have been trying to tell about that since the 10th day. You wanted Edit command not to write anything until Properties dialog confirms the write and now it's implemented. But remember that I also added a "Create External Tags" command that will force-write external tags to tracks. The command is hidden by default so seeing it requires holding shift when opening the menu or ticking its checkbox in context menu preferences to make it always visible.
Title: Re: External Tags
Post by: Anakunda on 2018-12-17 09:14:50
A yesterday's update introduces a new bug: Context>Edit External Tags doesn't create folder.tags => Any further edit writes directly to audio files. Having the prefs to prefer folder tags, write stream tags to SQlite and read any format.

Damn, I forgot to read changelog, delete this post.
Title: Re: External Tags
Post by: Case on 2018-12-17 14:29:56
I didn't even consider that scenario, I was so accustomed to people using the Edit menu for all external tag editing. Hope you didn't ruin anything permanently.
Title: Re: External Tags
Post by: Peter on 2018-12-19 14:35:46
OK, I found the "issue" with the "/", and it seems "independent of" External Tags: If I force MP3 files into ID3v2.3, it seems that Tom / Dick / Harry becomes a multivalue field. So if fb2k
- has Tom / Dick / Harry
- creates External Tags out of that
- commits to files
it does sometimes happen that it comes out as multivalue and reads Tom; Dick; Harry.

But, I provoked the same to happen by "Rewrite file tags" without invoking External Tags. @Peter , is this expected behaviour?


Test version with a new context command for finding tracks edited since external tagging. If it finds such tracks it will create a new playlist and place the findings there.

All testing for this post done with that. Seems to work.

ID3v2.3 specification says that multi value fields are to be delimited with forward slashes. Real support for multi value fields was introduced with 2.4.
foobar2000 slightly bends the spec by delimiting the multi value fields with " / " (with the spaces), so actual artist names with slashes do not become multiple artists.
Title: Re: External Tags
Post by: Awesomeo on 2019-01-03 23:05:37
Heh, I've just tested the component without reading much into it (bravo me). I chose the sqlite option, because I love the idea of a neat .db file with all my extra info in there. And only then I noticed that external tags supersede the file tags. Looks like I was rather thinking about a use case I found posted here earlier:
Hi, is it possible to implement the addition of selective tags to an external file, and add the rest of the tags as usual? (For example, to save personal or confidential tags separately from the music file). Thanks.
Likewise, I thought about using external tags as something additional only for my personal purposes, like ReplayGain data, maybe my own set of ratings, tags, moods, comments or anything else that wasn't intended by the artist.

In the end it's not a big deal. Just a little bit redundant in my scenario because I will be left with a whole library of music files with [basic set of tags like artist, title, date] and quite a huge .db file with exactly the same [basic set of tags] + [some additional custom info].

Still, it's a great component, long sought after. Thanks!
Title: Re: External Tags
Post by: iridescentaudio on 2019-01-16 11:02:22
Hi, I hope this is the correct place to ask. If this issue has been addressed already I apologise but I couldn't find reference to it earlier in the thread.

I recently updated foo_external_tags to 1.0.19, though this may be coincidental as I also updated foobar2000 to 1.4.1. I have recently noticed that many of the external tags I have created in the past are no longer recognised in foobar2000 playlists - fields are appearing empty. It seems like it may only be certain formats that are affected, most notably modules (foo_dumb) and VGM (foo_input_vgm) in my experience. Example:

https://www.dropbox.com/s/own6853yh1dubye/externaltags.JPG?dl=0

When I select the "Edit External Tags" option for songs I know to have external tags like in the above screencap, it's clear that the tag info is safe, but I don't understand why it isn't propagating to playlists automatically. Manually selecting the Edit External Tags -> Reload Info option doesn't work either, and I expected it would, the only thing that does restore the external tags is to modify them to 'force' them to re-propagate. For practical reasons I would prefer not to have to carte-blanche modify (presently) 4,000 or so TAG files to add & then remove arbitrary junk data; is this my only option for getting them to re-propagate in playlists or is there a more elegant solution & explanation for why these tags aren't being picked up without intervention? I've also uploaded one example below if it could help diagnose the issue, though of course no guarantee it'll manifest the same problems on other computers as I'm not sure whether the source of the issue is this component or the main application.

https://www.dropbox.com/s/mtdwzxjge04hdov/Just%20For%20Fun.xm?dl=0
https://www.dropbox.com/s/25fgknzwgfiivgw/Just%20For%20Fun.xm.tag?dl=0

Thanks.
Title: Re: External Tags
Post by: Case on 2019-01-16 11:23:00
The problem could be caused by having wrong decoder priorities. Open preferences and verify on the playback -> decoding screen that "External Tags (reader)" is at the top.
Title: Re: External Tags
Post by: iridescentaudio on 2019-01-16 12:02:32
Aha, thank you Case! That was indeed the problem, though it isn't clear how the tag reader fell lower down the order of priorities - I'll keep an eye on this in future. Fortunately it was only foo_openmpt (actually) and foo_input_vgm that were higher priority so only those files need info reloaded.
Title: Re: External Tags
Post by: concept303 on 2019-01-28 04:54:50
Hi and thanks for this wonderful component and your hard work. It is much appreciated.
A few questions from me and please excuse my ignorance.
1. How can I enter a multivalued tag using external tags? Use the " / " separator? Something else?
2. I notice a bug when choosing File Operations > Copy to... on a file that has an external tag. The file copies, but the folder.tags file is not also copied to the new folder.

Once again thanks for your work and looking forward to use this component heavily (it is a life saver and better IMHO than m-tags).
Title: Re: External Tags
Post by: concept303 on 2019-01-28 10:22:18
1. How can I enter a multivalued tag using external tags? Use the " / " separator? Something else?
Okay, I have managed to find an answer for this here: https://hydrogenaud.io/index.php/topic,90371.0.html
Title: Re: External Tags
Post by: Case on 2019-01-28 10:46:54
Multivalue field separator is semicolon (;). The component uses standard properties dialog so same rules apply to external tags and regular tags.
Tag value copying isn't implemented. I assumed it isn't necessary. If you think it would be useful I can add the feature. But I can't think of use for track copying that doesn't involve taking the files away from current foobar2000 instance so it won't be added to SQLite database.
Title: Re: External Tags
Post by: concept303 on 2019-01-28 11:10:03
Tag value copying isn't implemented. I assumed it isn't necessary. If you think it would be useful I can add the feature.

Thanks Case. This feature would be useful, but not critical (at least to me). I am also not sure of the amount of work it requires. If it is easy, it could perhaps be added as a checkbox option in Advanced properties...something like "Copy external tag file(s) on file copy/move operations".

There is something else I discovered. I think it is a bug, unless I am misunderstanding something.
The issue is that when writing directly to the file's tags using the "Edit file tags" context menu command, the changes are not visible if I invoke again "Edit file tags" to do another edit.

To replicate:

If your restart foobar2000, then "Edit external tags" will show the value.

Alternatively, if we had set the tag via Right click > Properties, it would be immediately visible when using Edit file tags.

Hope I explained it clearly.

PS: In case it is important, I am doing these tests on FLAC files and under Preferences > Advanced > Tagging > External Tags I have selected the option "Use only folder tags...)

Title: Re: External Tags
Post by: Case on 2019-01-28 17:46:44
Adding tag writing for file copying isn't too much work. I can do that for the next version. But I seem unable to trigger the problem you described. Are the steps perhaps mixing up file tag editing and external tag editing? Editing file tags should produce no visible changes in foobar2000 for a file that has external tag present.
Title: Re: External Tags
Post by: concept303 on 2019-01-29 11:48:59
Hmm...I will try to describe this a bit differently.


I would expect the tag to show everywhere immediately after I enter it and reload the tags from file. I also would expect that it does not disappear when I press the Apply button. For the record, External Tags (reader) is first in the Decoding priority and External tags (Writer) is last (From what I am reading I suppose that's the way it should be. I installed external tags as my last component to make sure I get this order).
Title: Re: External Tags
Post by: Case on 2019-01-29 21:04:30
Fixed version released. Also implemented the external tag copying.
Title: Re: External Tags
Post by: Anakunda on 2019-01-30 09:49:54
A bug is here with latest update: when creating external tags for CUEsheet items, the original tags are copied+preserved only till first change. After that all items have the same name as 1st one (not changeable).
Title: Re: External Tags
Post by: Case on 2019-01-30 11:55:18
Thanks for reporting. I feared the way I fixed the refresh issue would have side effects and now I know what those were. Fixed the refresh issue in a better way to get subsong formats working again.
Title: Re: External Tags
Post by: concept303 on 2019-01-31 11:54:17
Fixed version released. Also implemented the external tag copying.

Thanks Case, will test.
Title: Re: External Tags
Post by: arch21 on 2019-02-03 06:02:27
I have an issue. I have a MP3 file with external tag. I want to replace the MP3 file with better quality (e.g 128 to 320 kbps) and keep using the tag file. All tag looks fine but general info still use info from old file, Any solution without recreate the external tag? thanks.

I'm sorry. I believe I did see this, but when I try to recreate the issue with other file, it doesn't happen.
Title: Re: External Tags
Post by: Case on 2019-02-03 07:54:26
If you do that and see old info, just reload tags from properties dialog or shift+clicked tagging menu.
Title: Re: External Tags
Post by: seriousstas on 2019-02-16 01:04:51
How add tags to the CUE sheet (*cue.tag) automatically when adding from the library?

How disable properties window call when "Create external tags"?
Title: Re: External Tags
Post by: Case on 2019-02-16 07:43:08
There is no automatic tag creation implemented and I see no reason to add such a thing.

There is no option to disable properties dialog opening. You can use the dialog to verify that all tracks got external tags and make any changes you wish. Or just close it instantly if there's no need for that. I could add a setting for this behavior if it is a huge bother.
Title: Re: External Tags
Post by: seriousstas on 2019-02-24 11:50:46
Quote
I see no reason to add such a thing
I can not mark  favorite tracks (Mood), for example in this playlist :
https://www.deviantart.com/br3tt/art/JSPlaylist-509803158
without * .cue.tag
At the same time https://sourceforge.net/projects/sacddecoder/files/
Super Audio CD Decoder (https://sourceforge.net/projects/sacddecoder/files/) - creates (Editable Tags) automatically.
And it's really comfortable.
Quote
I could add a setting for this behavior
Thanx!
Title: Re: External Tags
Post by: Case on 2019-02-24 13:25:02
You can force External Tags to take over cue sheet tagging by adjusting decoder priorities in Preferences. Drag "foobar2000 Cue Sheet Reader" below the "External Tags (writer)" and any tagging you try to perform with cues will go to external tags.

I uploaded a new version with possibility to disable properties dialog opening when creating tags. The new setting - like all the other options - can be found under Preferences -> Advanced -> Tagging -> External Tags.
Title: Re: External Tags
Post by: seriousstas on 2019-02-24 18:49:59
You can force External Tags to take over cue sheet tagging by adjusting decoder priorities in Preferences. Drag "foobar2000 Cue Sheet Reader" below the "External Tags (writer)" and any tagging you try to perform with cues will go to external tags.
Thank! This is what I need.
Title: Re: External Tags
Post by: iridescentaudio on 2019-02-25 15:47:51
I uploaded a new version with possibility to disable properties dialog opening when creating tags. The new setting - like all the other options - can be found under Preferences -> Advanced -> Tagging -> External Tags.

This feature doesn't seem to be working for me, unless I am misunderstanding how it works. I've unchecked the "Open properties (...)" option in Preferences, yet I'm still able to open the properties dialog and make changes to files for which external tags already exist (this is a concern with VGM, as certain fields can be edited natively whilst others cannot.) This could be a great and very useful feature because I often (habitually) open the properties dialog by mistake, instead of the edit external tag dialog, and would like to be prevented from doing that once I have the external tags. Can't figure out what I'm doing wrong though?

Screencap: https://www.dropbox.com/s/ungt0gqq7n63hw5/propertiesstillworks.png?dl=0
Title: Re: External Tags
Post by: Case on 2019-02-25 16:49:04
The option affects the behavior of "Create external tags" command. That command immediately writes external tags for selected tracks and by default opens the properties dialog showing the selected tracks and their tags. Unticking the new option disables the automatic properties dialog opening.

Note that you don't need to use the "Edit external tags" dialog for your situation if the decoder priorities are set correctly. If any External Tags decoder has higher priority than the format you are dealing with the component will notice the existing external tag and will behave just like you had used the custom menu command.
Title: Re: External Tags
Post by: iridescentaudio on 2019-03-01 17:12:12
Thank you Case; it looks I fully misunderstood indeed. I wasn't even aware of the Create External Tags option before, but I'm now using it assigned to a custom button and it certainly works better for my purposes without the Properties dialogue opening each time.

I also didn't realise your second point, that internal tags couldn't be touched once external tags had been generated - also great news, So, double thank you. Both of these new bits of info together have hugely streamlined tag migration for me.

I also have a little protip of my own, which may have been mentioned already, but in case it hasn't:
Go to File->Preferences->Display->Default User Interface->Playlist View and create a Custom Column for "Tag Type" using the pattern %__tagtype%. This column makes it very easy to see at a glance within foobar2000 which of your files have external tags present (e.g. "External APEv2") and which do not, so you should never have doubts about what tag you're editing. Far more convenient than opening containing folders to check for the presence of tag files.

I very very very like this component, thank you for developing it.
Title: Re: External Tags
Post by: Porcus on 2019-04-04 20:53:20
I currently use folder.tags.
What is the best way to write to SQL - without going by way of commit? (Preferably without deleting folder.tags files which I want to keep for backup - but I can always run a copy loop.)
Title: Re: External Tags
Post by: Case on 2019-04-05 07:02:25
It doesn't really seem doable at the moment without using commit. I'll see what kind of changes are required to support this.
Title: Re: External Tags
Post by: Case on 2019-04-07 16:38:39
I added a simple checkbox to preferences to force writing tags in the preferred format. With that force writing setting you can just select to prefer SQLite and use "Tagging" -> "Rewrite file tags" to copy the content over.
Title: Re: External Tags
Post by: Sergey77 on 2019-05-09 16:10:04
Hi there!

Case,
1. When "External Tags (writer)" is on, a playlist item is played even when the decoders are off (flac, mpeg, etc. decoders).
2. HLS links with the created "External Tag" are played even when the "FFmpeg Decoder Wrapper" is turned off ("External Tags (writer)" must be on).
3. If the "External Tag" is created for example an mp3 or flac file, it is played even if this decoder is off ("External Tags (reader)" must be on, "External Tags (writer)" can be turned off).
is this how it should be? take a look, please.

Thank you!
Title: Re: External Tags
Post by: Case on 2019-05-10 12:51:40
That is unexpected behavior but as far as I can tell it should be solved in the core. This component requests a decoder from the player and it should not return disabled ones in my opinion. I have asked Peter about this but so far haven't gotten a reply.
Title: Re: External Tags
Post by: abax2000 on 2019-06-09 18:33:40
Dear Case and testers...thank you.
Title: Re: External Tags
Post by: hakadespra on 2019-06-10 16:25:50
EDIT: I've found it out by myself

This is just excellent! I started to attach images to my videogame music collection just yesterday. But how does attaching images work exactly? I thought the external .tag file contains a link to the image, but I did not find that link, just "album art = hello.jpg" or something like that. Could someone please tell me how attaching images is working with this new plug-in?
Title: Re: External Tags
Post by: thisbanisnotsettoexpire on 2019-07-28 17:55:12
There is an option in foobar 2000 preferences:
This option, being set, along with foo_external_tags preferences set to "Use only SQLite (fastest)" and "Always write external tags in preferred format" (I listed only relevant, as I see it, foo_external_tags options), leads to tag update error, when "OK"/"Apply" button is pressed in Tagging -> Edit external tags window (after changing any tag value): One file could not be updated: Invalid path with following information in status log:
Code: [Select]
Could not update info on:
exttag://(fy+https://www.youtube.com/watch?v=XXXXXXX)
Reason: Invalid path

Which is understandable, though it would be nice to somehow fix either foobar2000, or foo_external_tags to not produce this error.

Anyway, just reporting it, maybe it will help somebody else somewhen later. Sorry for bothering, if this particular situation is a common knowledge or was noted earlier in this thread.

Title: Re: External Tags
Post by: Case on 2019-08-07 19:22:59
New version out with support for the new API introduced in foobar2000 v1.5 beta 8 (http://www.foobar2000.org/download).

After install on the new foobar2000 version the component must be manually enabled by ticking External Tags under Preferences -> Tools -> Track Info Filters. Once that is done External Tags can provide metadata without using decoder hacks and is fully compatible with Skip Track and foo_youtube.
Title: Re: External Tags
Post by: thisbanisnotsettoexpire on 2019-08-07 21:54:11
New version out with support for the new API introduced in foobar2000 v1.5 beta 8 (http://www.foobar2000.org/download).

After install on the new foobar2000 version the component must be manually enabled by ticking External Tags under Preferences -> Tools -> Track Info Filters. Once that is done External Tags can provide metadata without using decoder hacks and is fully compatible with Skip Track and foo_youtube.
Fabulous! Thank you very much!

What is the meaning of new Take over all tagging preference? I still have External Tags (writer) in PreferencesPlaybackDecoding list, is it OK?
Title: Re: External Tags
Post by: arch21 on 2019-08-07 23:33:40
after this update, I can't load youtube playlist via foo_youtube at all with writer enabled, regardless issue with foo_youtube itself that I have reported.
Title: Re: External Tags
Post by: Case on 2019-08-08 06:43:06
What is the meaning of new Take over all tagging preference? I still have External Tags (writer) in PreferencesPlaybackDecoding list, is it OK?
The intention was to get rid of both decoders but currently I can't achieve the Tagging -> Edit External Tags and Edit file tags features with the new interface. The new setting is for people who wanted all tagging to go to external tags and achieved it by having "writer" on top.
after this update, I can't load youtube playlist via foo_youtube at all with writer enabled, regardless issue with foo_youtube itself that I have reported.
I lifted the ban on foo_youtube's files to allow thisbanisnotsettoexpire to tag them. I don't really understand how the decoder that has lowest priority can prevent foo_youtube from working.
I'll see what more I can do.
Title: Re: External Tags
Post by: Case on 2019-08-09 10:46:25
New version out that should both allow Youtube tagging on the latest beta and not prevent playlist loading.
Title: Re: External Tags
Post by: Sergey77 on 2019-08-09 16:52:48
Hi there!
@Case, The command "Create External Tag" no longer works for "Use only APE tags" mode? or am I missing something?
For "Use only SQLite" mode works as expected. Check please. Thanks!
fb2k v1.5 b9
ETags v1.5.1
Title: Re: External Tags
Post by: Case on 2019-08-09 19:43:43
Works fine here. I tried it on regular streams, youtube links and on local files. I'm afraid I need more info where and how it fails.
Title: Re: External Tags
Post by: Sergey77 on 2019-08-10 02:43:35
By executing the "Create External Tags" command in the "Use only APE tags" mode, I noticed the following:
1. The console displays an error message (see attached pic). This behavior is the same for local files, stream and youtube links.
2. For stream and youtube links short files are created in the "external-tags" directory (samples are attached). For local files this does not happen.
Title: Re: External Tags
Post by: Case on 2019-08-10 09:00:26
I'm sorry, I forgot I'm running a newer alpha build. The beta version had enabled ancient lyrics3 tag code which introduced tag-related problems like crashing (https://hydrogenaud.io/index.php/topic,118024.0.html) and failure to read tags (https://hydrogenaud.io/index.php/topic,118025.0.html). It's also breaking my external APE tag creation, it somehow gets confused from the header I write.
Hopefully Peter gets a new beta out soon as that is required to fix this.
Title: Re: External Tags
Post by: sveakul on 2019-08-10 22:21:15
Thanks Sergey77 and Case for the heads-up on this issue, which came at the right time to keep me from updating to Foobar 1.5 beta.  Successful operation of the APE External Tags function is critical to my use of Foobar.  A question: would the use of ANY version of External Tags in the current beta Foobar be affected by this, or just the new 1.5.x versions?
Title: Re: External Tags
Post by: Case on 2019-08-11 06:15:05
All versions of the component are affected. But if you would like to try the new foobar2000 beta here's a replacement foo_input_std that allows the tagging functionality to work.

Edit: Obsolete attachment removed.
Title: Re: External Tags
Post by: Sergey77 on 2019-08-11 15:16:56
Case, thank you for the opportunity to pre-test. I note the following:
1. Tagging/Attach pictures doesn’t add images after applying "Wrap for External Tags" for streams.
2. Again the contents of the playlist fields $meta(genre) and $meta(url) disappear during playback of streams. It was discussed earlier Reply #81 (https://hydrogenaud.io/index.php/topic,116141.msg963840.html#msg963840) and changed for ETags v0.9.8.
Title: Re: External Tags
Post by: Case on 2019-08-11 15:39:10
Thanks for testing.
1. The image actually is added but since my input is now missing there is no handler present for the image. Will have to discuss about this with Peter.
2. Since my input is missing there's no dynamic info presenter there to give the data. Again I'll talk to Peter.
Title: Re: External Tags
Post by: Porcus on 2019-08-12 08:12:50
Compatibility issue:
Having foo_external_tags merely installed - without using it for anything! - breaks foo_dynamic_range and makes it throw an "Unable to open audio data:" error.
Version: 1.5.1 as updated by fb2k (the beta 9). I don't keep old versions, but it "must have" happened quite recently.
Title: Re: External Tags
Post by: arch21 on 2019-08-12 08:33:07
I see BPM Analyser has issue with v1.5.1, no issue with v1.5.
Title: Re: External Tags
Post by: Case on 2019-08-12 17:21:50
The new APIs apparently don't currently play well together with components made with the pre-1.4 SDKs. There are similar problems with foo_wave_seekbar (https://hydrogenaud.io/index.php/topic,118045.0.html). These require fixing in the core and will be working in the next beta.
Title: Re: External Tags
Post by: sveakul on 2019-08-12 19:02:23
...These require fixing in the core and will be working in the next beta.
That's good news, thanks Case!
Title: Re: External Tags
Post by: Case on 2019-08-14 21:18:35
There's a new version of the component out to go with the today released foobar2000 1.5 beta 10 (http://www.foobar2000.org/download). Stream metadata and album art now work.
Title: Re: External Tags
Post by: Anakunda on 2019-08-15 13:22:24
Here's a new problem with 1.5.2 update: foo Dynamic Range stops work reporting it can't open scanned file. It may be also because of I'm having installed alot of plugins, exceeding file handles pool or something so. Back to external tags 1.5.1 and the problem is gone. I'm using foobar 1.4.6 stable if it's not compatible already.
Title: Re: External Tags
Post by: Case on 2019-08-15 15:52:03
Looks like a bug in the core that was just fixed in the beta series. Peter mentioned the bug was introduced with 1.4 series. All components made with old SDK fail at using decoders.
I'd recommend upgrading to foobar2000 v1.5 even if it's beta. External Tags no longer has to do hacky things to work there and it has quite a bit of other improvements too. No reason to avoid it.
Title: Re: External Tags
Post by: Sergey77 on 2019-08-15 16:08:13
There's a new version of the component out to go with the today released foobar2000 1.5 beta 10 (http://www.foobar2000.org/download). Stream metadata and album art now work.
It seems to work fine! thanks Peter and Case!
Title: Re: External Tags
Post by: Case on 2019-08-15 18:35:33
Peter confirmed the 1.4.6 issue is the same bug that affected the earlier foobar2000 v1.5 betas. But there was a workaround so I released a new version with one.
Title: Re: External Tags
Post by: sveakul on 2019-08-16 03:18:58
Just updated to 1.5 beta 10 and External Tags is "cookin' with Crisco", thanks Case.
Title: Re: External Tags
Post by: Anakunda on 2019-08-17 11:07:43
Alot of problems with foobar 1.5 beta. Updating tags on DSD files directly is not possible because of error Could not update tags (this was possible directly with version 1.46 stable). Then making external tags and change them via properties dialog, works. But again whenever applying changes to tags made by 3rd party plugin (RG-scan, Masstager etc.), I get again this error. External Tags aren't taken into account but tags always are written directly. Surprisingly External Tags (reader) isn't listed in decoders list at all. Is that intentional?
Title: Re: External Tags
Post by: Anakunda on 2019-08-17 15:03:40
It may ber related to this issue https://hydrogenaud.io/index.php/topic,118068.0.html (https://hydrogenaud.io/index.php/topic,118068.0.html). Spontaneously the plugin seems to stop read/write external tags.  Installed version is 1.5.3.

/edit: Confirmed. Back to foobar stable + ET 1.5.1, Both Reader and Writer appear among decoders, which is IMO proper function.
Title: Re: External Tags
Post by: sveakul on 2019-08-17 17:41:18
@Anakunda:  the "Reader" part is no longer there by design in the newest version which was modified for the new Foobar core.  Have you checked the box in Tools/Track Info Filters/External Tags Case refers to here: https://hydrogenaud.io/index.php/topic,116141.msg974079.html#msg974079 (https://hydrogenaud.io/index.php/topic,116141.msg974079.html#msg974079)
Title: Re: External Tags
Post by: Anakunda on 2019-08-17 17:51:53
Aah, I had to miss that, thanks for notifying. Now testing new foobar with lastest plugin and hopefully things will sort out.
Title: Re: External Tags
Post by: sveakul on 2019-08-17 21:01:49
@Case:  IMO it would be a good idea for the Track Info Filters/External Tags box to come checked by default after the initial installation of External Tags?  Easy to miss this otherwise.
Title: Re: External Tags
Post by: Case on 2019-08-18 11:40:59
I agree but Peter made it an opt-in feature. Hopefully we can convince a change for 1.5 final
Title: Re: External Tags
Post by: iridescentaudio on 2019-08-19 18:05:09
Hi, currently having a meltdown, not sure where to start or if this is a good place to post considering the number of issues happening simultaneously. (if moderators would like to move this message elsewhere feel free)

I recently started using External Tags for *everything*, that's including MP3s, FLACs, WMAs and other formats that already have robust tags (won't go into why right now.) Also enabled the tag<->stats synchronization if that matters and manually wrote all the stats to external tags this morning.

Everything seemed fine, until spontaneously today in the last hour or so, I noticed certain files/formats suddenly lost their tags completely - principally WMA,  XA, IDSP and some other lesser known formats. I've tried reloading the tag info for those, but it does nothing, just completely blank. Tried removing the .tag files from their respective directories and reloading info - still blank, the WMAs definitely have internal metadata but it's not being read. I've literally just noticed while typing this that those formats in particular (I think?) and maybe other formats are now not playing *at all* in foobar2000. So the tag loss seems symptomatic of something greater going on. To be clear, here are a couple of the messages I've seen when attempting playback:

Code: [Select]
Wave cache: generic IO exception (Unexpected subsong index) for "D:\Dave\Music\G\George Benson - A Foggy Day.wma" / index: 1
Code: [Select]
Opening track for playback: "D:\Dave\Music\GameCube\Sonic Gems Collection\history.adx" / index: 1
Unable to open item for playback (Unsupported format or corrupted file):

Watching the foobar2000 console just shows lots of tag reading messages with no errors that I can see. Progressively, all of my external tags are being dropped as foobar2000 is re-reading my library and failing to load them, plus as soon as I access a file they disappear/revert to internal tags of course... foobar2000 is hanging constantly and sometimes crashing too while this is going on but that could just be due to media library activity, All kinds of crazy stuff is going on. I am sat here watching my "Faves" playlist decrease in number as the tags are being disappeared.

Thinking it might be a hard drive failure I checked my music drive for errors - nothing reported. Also checked my Windows 10 harddrive where fb2k is installed - also no errors reported. And I've also tried playing problematic WMAs in Windows Media Player where they're fine, and haven't yet noticed any file access problems elsewhere - my photos still pen in photo viewer, etc etc. This seems like a foobar2000-centric issue, but the weird thing is how it seems to have struck totally at random without even being closed or re-opened.

I'm not sure what else to tell you but this is very concerning... I'm hopeful that External Tags is the sole cause of the problem but it seems far more cataclysmic and External Tags is just one of many components biting the dust? Please help if you can & suggest things for me to try! I'd like to just restart my computer and go from there but not sure what will happen after that, and in my haste I'm now undergoing a full backup of my Music directory. sorry for my very disjointed and verbose post... Thank you!
Title: Re: External Tags
Post by: Case on 2019-08-19 19:14:54
You don't mention a single version number. Your problems could happen if you for example used foobar2000 v1.4.x and non-latest version of the component.
I recommend using the latest foobar2000 v1.5 beta version and the latest version of the component. Make sure you manually enable the component on the new foobar2000 under Preferences -> Tools -> Track Info Filters.
Title: Re: External Tags
Post by: iridescentaudio on 2019-08-19 20:11:27
Very sorry about that Case,.. I was panicking and not thinking straight.
I've updated to the newest fb2k beta and External Tags 1.5.3, and have manually enabled it.

I tried accessing a few files I knew to be otherwise non-problematic formats and those picked up their External Tags again, which is very reassuring, but tag reading still isn't working for e.g. WMAs. They are playing (again), but not fetching metadata from the tag files, nor are they defaulting to their internal metadata. (Also attempting to load an XA crashed the application/foo_adpcm.)
The difficulty for me as a layperson is that it's unclear the extent to which this is an interaction with External Tags or indeed has zero relevance to you/your software, due to the simultaneous nature by which things went horribly wrong.

I can't do any other testing for the time-being as I'm currently reloading tag info for my entire library, which is enormous and will take hours to complete ~ I'll report back later. Thanks.
Title: Re: External Tags
Post by: kode54 on 2019-08-20 08:03:56
Is VGMStream somehow higher in your decoder priority list than the core player's WMA input? VGMStream does claim to support .wma files, will play them (and downmix them to 16 bits per sample), and has absolutely zero support for their tags.

VGMStream also defaults itself to going straight to the bottom of the input priority list, for the express reason that it has several colliding file type extensions, and has very bad support for those generic file types.
Title: Re: External Tags
Post by: Case on 2019-08-20 08:18:07
No decoder should affect the external tag behavior with the new system. Hopefully @iridescentaudio can provide some more info to figure out what is the problem with the WMAs.

While doing some WMA testing I noticed a bug with the new system - "Edit file tags" doesn't edit file tags but external.
Title: Re: External Tags
Post by: iridescentaudio on 2019-08-20 11:27:38
All right, I am mostly back to normal, and my hard drive is probably fine. External tags are working for all but a small, specific minority of files - actually just WMA bothers me now. One major reason why I began using them for everything yesterday is precisely because of wanting to avoid such volatility with foobar2000 playback statistics and tags moving forwards.

A common theme with most of the remaining problem files is that %SUBSONG% is >0 (I see in the changelog that subsongs have been a concern in the past) and that they are either streamed formats that are related to vgmstream and adpcm components (which I have reinstalled), or they are WMA. In any case the external tags aren't working so I've removed all of them. Other game audio formats that use subsongs work, though I did have to manually intervene with some subsong'd foo_openmpt/module formats (I just deleted/recreated the external tags.)

Is VGMStream somehow higher in your decoder priority list than the core player's WMA input? VGMStream does claim to support .wma files, will play them (and downmix them to 16 bits per sample), and has absolutely zero support for their tags.

That would seem to explain the problem as yes, it was... I've moved foobar2000 WMA decoders to the top of the list and VGMStream to the bottom, deleted all WMA external tags and restarted foobar2000 at least twice, but I'm still unable to reload internal tag info from WMAs. I generated the external tags yesterday, likely whilst VGMStream was erroneously reading WMA, and even though the .tags are deleted, I can't refresh from the internal metadata to recreate them - has foobar2000 somehow memorised their blank state? (though if this was the case I might expect to see an internal APEV2 flag...)

Also what I have noticed is that this only applies to WMAs where %CODEC% is reported as Windows Media Audio 2, which all have a reported %SUBSONG% index of 1.
Those were producing an Unexpected subsong index error upon playback too but I think they are playing ok since fixing component priorities (time will tell.)
Where %CODEC% is reported as WMA (which have %SUBSONG% 0), they play fine, and tags internal or external work as expected, basically zero problems.

I had more written up going into more detail for other formats that I was going to post in a new thread, feeling it may not be relevant to external tags. Might post about that later, but one thing at a time.

Any other information that you'd like me to provide please let me know.
Title: Re: External Tags
Post by: Case on 2019-08-20 12:55:46
Thanks for the extra info. If the subsong index for the playlist entry differs from the subsong stored in the external tag the metadata there will be ignored. Sounds like kode54 was correct about the decoders if they have different subsong indexing.
You may need to remove the files from the media library or playlist and re-add them to get them to use the correct subsong numbers. After that if external tags are still missing re-create the tags.
Title: Re: External Tags
Post by: iridescentaudio on 2019-08-20 14:28:37
You may need to remove the files from the media library or playlist and re-add them to get them to use the correct subsong numbers.

This fixed the remaining files ~ huge relief, I'm back to 100% external tags with knock-on-wood zero problems, and I've learned a few things too, so thank you very much (to both of you.) While I hadn't mentioned it I was experiencing the same problem with Rdos AdLib (RAW) files as well, where I'd mistakenly generated external tags whilst decoders had been incorrectly configured and so were persistently being flagged as RAW Little Endian audio. Before removing their external tags, they were playing in that format as well (ouch my ears) so that was going to be my next question. I'll know better for the next time something like this happens, and not immediately assume my drives are imploding.
Title: Re: External Tags
Post by: bigexplosions on 2019-08-22 02:36:37
I think I made a weird problem for myself.

On fb2k v1.4.6, updated external tags, some decoders, masstagger. Foobar starts crashing on startup.
I find disabling foo_external_tags stops the crashing. I downgrade to the some old version of external_tags I had downloaded (1.0.3?)
I decide to update foobar to v1.5 beta instead. I update external_tags again. It doesn't crash again.

Now, a large amount of my files don't have their tag files read in the library (my autoplaylists are all incorrect). However, when the file is actually playing it displays the external tag fine, it shows on the playlist, item details, etc, but the library doesn't seem to do anything with the data, and then it stops displaying the tag file data when playing a different file.

When I edit the external tag data it rewrites it in a slightly different structure but then it is read properly. If I try changing the properties directly it overwrites the tag file.
Removing/readding the files from the media library doesn't change anything. I could try just adding/removing junk fields to all files to force the external tag rewrite but that seems risky...
Title: Re: External Tags
Post by: sveakul on 2019-08-22 03:38:47
Have you:

1.  Updated Foobar to 1.5 beta 10?

2.  Then, updated to External Tags 1.5.3?

3.  In Foobar Preferences/Tools/Track Info Filters made sure that the new box for "External Tags" is checked?
Title: Re: External Tags
Post by: bigexplosions on 2019-08-22 03:46:46
Yeah, everything is already updated and checked. I noticed the rewritten tag file really isn't different except the order of tag fields is moved around sometimes.
Title: Re: External Tags
Post by: Case on 2019-08-22 07:45:25
On fb2k v1.4.6, updated external tags, some decoders, masstagger. Foobar starts crashing on startup.
Do you have any crash logs about this? I don't see any submitted crashes from the recent versions of foo_external_tags.

Unrelated to crashing but it looks like at least the latest 1.5.3 version fails showing external tags for me on 1.4.6. Apparently I need to keep the old version around for testing if this kind of accidents can happen.

Now, a large amount of my files don't have their tag files read in the library (my autoplaylists are all incorrect).
Library seems to ignore the filter info. Thanks for reporting.
Title: Re: External Tags
Post by: Case on 2019-08-22 13:34:36
I had forgotten to change the SDK to target foobar2000 v1.4 so some features of the component didn't work correctly. foobar2000 v1.4 was most seriously affected as the component appeared to be entirely non-operational.

I also made a mistake with my previous post where I mentioned that library seems to ignore filter info. Library shows information correctly but I made a silly mistake testing that.

There's a new version of the component out that fixes some issues and now uses properly configured SDK. Direct file manipulation functions like "Edit file tags" and "Commit external tags to files" should now work again - though they work best with foobar2000 v1.5 beta 11 that should be out soon.

If @bigexplosions still has problems with the new version please post back.
Title: Re: External Tags
Post by: Sergey77 on 2019-08-22 16:20:04
Case, FYI
an attempt to add a picture for streams creates an external tag automatically, right?
But the external tag created in this way does not support dynamic info $meta(genre) and $meta(url) fields.
However, an external tag created using the Сreate External Tags command works as expected.
Title: Re: External Tags
Post by: Case on 2019-08-22 19:53:49
Thanks for the problem finding. The fallback art writer will now create an external tag from existing info automatically so metadata won't get blanked in this case.
Title: Re: External Tags
Post by: Case on 2019-08-28 07:35:31
There is an option in foobar 2000 preferences:
  • Preferences window
  • -> Advanced tree section
  • -> Tagging
  • -> General
  • -> Preserve file creation/access/modification time when retagging

This option, being set, along with foo_external_tags preferences set to "Use only SQLite (fastest)" and "Always write external tags in preferred format" (I listed only relevant, as I see it, foo_external_tags options), leads to tag update error, when "OK"/"Apply" button is pressed in Tagging -> Edit external tags window (after changing any tag value): One file could not be updated: Invalid path with following information in status log:
Code: [Select]
Could not update info on:
exttag://(fy+https://www.youtube.com/watch?v=XXXXXXX)
Reason: Invalid path

Which is understandable, though it would be nice to somehow fix either foobar2000, or foo_external_tags to not produce this error.
Thanks for reporting. Latest version of the component has a filesystem wrapper for my custom protocols and this operation will no longer fail and timestamp preservation works when using "Tagging" -> "Edit file tags" command. Also next version of foobar2000 has a generic fix so timestamp manipulation failing will no longer abort the entire operation.
Title: Re: External Tags
Post by: Anakunda on 2019-09-28 12:51:59
Probably this is bug or unintended behaviour.
When updating embedded cover art in TAK audio, new external tags are always created and the artwork is stored there. TAK audio has a full decoding and tagging support given by TAK decoder plugin (in decoders list it's positioned above External Tags). If I disable ET writer, the artwork is normally stored in the tags, so it's no problem with the TAK component. Still working.
Title: Re: External Tags
Post by: Case on 2019-09-28 14:51:49
Interesting. This could be a foobar bug or by design. The mishap doesn't happen when the decoder properly sets art support to use the GUIDs from the input as the priorities match decoder priorities. Without matching GUIDs there is no defined order.
I had a version of my alternative TAK decoder with explicit album art support but I never released it as it didn't appear necessary. But now I see that it is. If you don't mind switching you can fix this issue by using TAK Decoder (alt) (https://foobar.hyv.fi/?view=foo_input_tak).
Title: Re: External Tags
Post by: kode54 on 2019-09-29 00:30:55
Fixed. It required an album art editor implementation, handily supplied by Case. I also replaced the original reader with the v2 one he supplied.

Previously, there was only an extractor/reader, not an editor/writer.
Title: Re: External Tags
Post by: Anakunda on 2019-09-29 01:14:43
Thanks for the quick fix
Title: Re: External Tags
Post by: peersoft on 2019-10-07 19:44:45
Hello, can this component tag Spotify tags retrieved by the foo_spotify component? I am just asking if it is possible by now. When I tried to add the BPM tag I had to get it calculated manually, after that I tried to add the BPM field via Tagging > Edit external tags menu command. The problem is my changes aren't accepted and the Properties dialog is being invoked again and again until I click Cancel.
Title: Re: External Tags
Post by: Case on 2019-10-07 20:49:13
I don't have Spotify but it should work with everything. Make sure you are on foobar2000 v1.5 (currently at beta 16/17) and that you haven't configured the component to only write folder tags. Folder tags require write access to the location the audio is stored at so they only work with local files.
Title: Re: External Tags
Post by: peersoft on 2019-10-10 12:09:40
Hi Case,

Thanks for your reply. I am blind and my screen reader does not announce states of treeview items in the Advanced Preferences. I used the default settings but yesterday fiddled with them a bit with no luck. Could you please look at the screenshot and tell me where to press Space Bar in order to make correct changes?
Title: Re: External Tags
Post by: Case on 2019-10-10 12:58:48
Your settings are correct. Your configuration is set to always write External Tags in SQLite database.

I registered for Spotify Premium and installed foo_input_spotify to test this and I could tag my test track just fine.

Make sure External Tags is enabled at Preferences / Tools / Track Info Filters. Also make sure "External Tags (writer)" is enabled at Preferences / Playback / Decoding.

 I asked Peter about the screenreader failing to read checkbox states, perhaps it's a bug in foobar.
Title: Re: External Tags
Post by: euamotubaina on 2019-10-11 15:11:22
Case, can I edit the APEv2 tags files with an external text editor?
Title: Re: External Tags
Post by: Case on 2019-10-11 16:26:06
Not really. APE tags (https://wiki.hydrogenaud.io/index.php?title=APEv2_specification) have binary length fields that need updating. You could edit the strings if their lengths didn't change and the editor didn't mess up the non-ascii parts.
Title: Re: External Tags
Post by: Awesomeo on 2019-10-11 16:45:52
Peter wrote once about SQLite in a thread about 64 builds:
Quote
There are other options for improving large media library search performance at cost of component compatibility, for an example replacing the ancient metadb design with a modern SQLite backend - which would solve slow search, slow startup, slow shutdown and large memory usage.

So does it imply that external tags database is much faster than foobar's internal one?
Title: Re: External Tags
Post by: Case on 2019-10-11 18:04:40
SQLite may be faster for some tasks. But all operations go through foobar's database so any potential speed benefit is irrelevant.
Title: Re: External Tags
Post by: euamotubaina on 2019-10-11 23:58:22
Not really. APE tags (https://wiki.hydrogenaud.io/index.php?title=APEv2_specification) have binary length fields that need updating. You could edit the strings if their lengths didn't change and the editor didn't mess up the non-ascii parts.

alright, thanks. so maybe I can read it and decode it using some python module.

thanks for the help
Title: Re: External Tags
Post by: peersoft on 2019-10-12 10:53:11
Hi Case,
unfortunately no luck tagging. I have foo_input_spotify 0.0.4, I even tried to move the writer decoder to the top (although not recommended) with no change. Where is the database create so that I could check it is actually written? I even tried to execute Create external tags and Wrap for external tags command (although I don't know what these commands are doing). I have my foobar2000 in Portable Mode in the OneDrive synchronized folder (at D:\OneDrive\Documents\foobar2000) but foobar2000 can normally write to it. Strangely my Properties dialog on the Details tab says it is an external tag in SQLite. My file path is File path : exttag://spotify:track:5ZxWXosb6QEVvdDU6fItW8 . My problem is that whenever I try to use the Edit external tags command and I enter some additional tag like the BPM or SKIP tag the information is changed in the dialog but when I press OK I am back in the Properties dielog and when I press Apply it remains in the same state and I can keep pressing the OK button, always returning into Properties.
Title: Re: External Tags
Post by: peersoft on 2019-10-12 11:02:20
OK I checked and have found the SQLite file. I looked into it in a text editor (no SQLite viewer at hand) and I could find my two Spotify tracks with their basic details as retrieved from Spotify but none of my extra tags I requested are there.
Title: Re: External Tags
Post by: Case on 2019-10-12 12:12:16
The "Wrap for External Tags" forces the component to take over the wrapped track. For example in foobar2000 v1.4 the normal properties dialog couldn't be used to tag streams at all without wrapping. And at least with 1.4 album art reader wasn't called for streams unless they were wrapped. You should never need to use it with foobar2000 v1.5.

I didn't realize until you mentioned SKIP tag that you also use the Skip Track component. Make sure it is the latest version as otherwise it can conflict External Tags. Using "Help" / "Check for updated components" menu command will download the latest in case it's not already in use.

Lastly if everything is up-to-date please check the console (View / Console) if tagging still fails. External Tags should report most error situations there.

I do all my testing with foo_input_spotify 0.0.4 version too. Downloaded from https://cpancake.me/spotify-on-foobar2000.html (https://cpancake.me/spotify-on-foobar2000.html) and a direct link to the download is https://cpancake.me/archives/foo_input_spotify.zip (https://cpancake.me/archives/foo_input_spotify.zip).
Title: Re: External Tags
Post by: peersoft on 2019-10-16 19:05:52
Hi all,
for those who might have similar problem as me I am posting the one crucial thing that has solved my problem. I wanted my tagging to preserve file modification time (found under Advanced > Tagging > General). As soon as I turned this off External tags has started working. Hope there will be a way to intercept this setting and ignore it with external tags so it won't clash.
Title: Re: External Tags
Post by: Case on 2019-10-16 20:48:48
Thanks for reporting back. The filesystem wrapper I added to better support timestamp preservation actually caused this problem. I just released a new version where my filesystem handler is modified to only be active for actual files and skip all other protocols.

Though it would appear the timestamp preservation fix added to foobar2000 v1.5 beta 12 is not fully working as External Tags doesn't work as a fallback tag writer. Just directly editing tags of an untagged Spotify track with Properties dialog doesn't get to External Tags as the timestamp reading fails with "Object not found" error.
Title: Re: External Tags
Post by: richard3840 on 2020-01-08 05:28:59
Hi. Does anyone know where the tags sqlite database file is located?
I'm trying to remove external tags from some MIDI files. (Shift + Right click the file -> Tagging -> Remove tags from files) but after doing that, it still says "Tag type: apev2 db" in the song properties.
Title: Re: External Tags
Post by: Case on 2020-01-08 18:30:18
The SQLite database is stored inside the foobar2000 configuration directory. With regular install that's %appdata%\foobar2000. With portable install it's the install dir. The database file is called external-tags.db.
But if you quoted the tag type correctly it doesn't come from External Tags. All tag types from this component start with name "External Tag". For example a tag from SQLite has type "External Tag (SQLite)".
Title: Re: External Tags
Post by: kode54 on 2020-01-08 22:28:25
It comes from foo_midi's own tag database system, which I don't know if it supports tag removal properly.
Title: Re: External Tags
Post by: richard3840 on 2020-01-09 03:36:01
Ah, okay. Thank you.
It's because i've had some problems with metadata like title and artist not following correctly when synchronizing my music folders across computers. That makes sense, if the tags are stored in a database seperate from the music folder.
I do not have a portable install, but a local install on both computers, which then both have the synchronized folder added in the media library.
Title: Re: External Tags
Post by: wiwi23 on 2020-03-25 17:37:14
HI,I have some trouble creating my own .tag file outside fb2k(v1.5.2):
this is the python code:
#############################################
import mutagen
from mutagen import apev2
import io
a = apev2.APEv2()
a['Album'] = 'Rain'
a['Artist'] = 'BlaBla'
buf = io.BytesIO()
a.save(buf)
# the audio file name is test.mp3
with open('test.mp3.tag', 'wb') as f:
    # mutagen's apev2 header don't have 'TAGFILE'
    # so add it in front and since header's `size` field
    # only count TAGS ITEM and footer, so no need to hack into
    # the original implementation to update the header's `size` field
    f.write(b'TAGFILE'+ buf.getvalue())
#############################################
and the external tag's configure is:
* Use only APE TAGS
* Take over all tagging
and it can't be recognized by fb2k. and something weird happened:
when i right click on the file > Taggging > Edit External Tags and add some other field.
suddenly it can be recognized and the fields tagged by python is in there.
I've checked a python created ape tag file and the one created totally by external tags and found no difference.
so I wonder it's trigger problem in external tags?
Title: Re: External Tags
Post by: Case on 2020-03-25 17:48:42
Have you tried reloading info from files? Generally speaking foobar2000 doesn't ask for new tag info if the file timestamps don't change from the last time the metadata was read.
Title: Re: External Tags
Post by: wiwi23 on 2020-03-25 18:40:30
It works! Thanks! I didn't even know there is a 'reload info' button. Sorry, I didn't read through all the comments in this thread due to difficulty  in reading English :(
but is there a convenient way to let fb2k reload all the info?

that's pretty weird. I remove it from playlist and add it back why fb2k doesn't reload the info. It stores all the file access info in somewhere?
Title: Re: External Tags
Post by: Case on 2020-03-26 06:01:23
foobar2000 caches metadata pretty aggressively. You can force reload info for all track in the media library for example with Album List (Library -> Album List). Hold shift while right clicking "All Music" entry at the top and select Tagging -> Reload info from file(s). Note that it can take a while with large library.
Title: Re: External Tags
Post by: wiwi23 on 2020-03-26 07:05:17
Thanks again. Now I know that simply `touch` the files works.
And here is the python code:
############################
from pathlib import Path
Path('path/to/test.mp3').touch()
############################
Title: Re: External Tags
Post by: iridescentaudio on 2020-04-10 16:51:08
Hi, I'm having some trouble with external tags not working correctly with a select few mp3s. (using External Tags version 1.5.9 - I only noticed this today, it may have been an issue for much longer.)
The mp3s in question all come from the same source. Here's just one short jingle uploaded as an example:

https://www.dropbox.com/s/fgnbhj95d9jt851/125_2_run_home_run_%28in_game%29.mp3?dl=0

What I am experiencing: if I generate an external tag for this or other related mp3s, upon playback the tag information disappears from foobar2000's playlist - as if the external tag isn't being read. On pressing stop, the tag information repopulates.

Things I have tried, but have not helped:
- Reducing the internal tags to only contain ID3v2
- Optimising the file layouts
- Fixing VBR MP3 headers
- Rebuilding MP3 streams
- Verifying integrity (all files concerned are reported as 'OK')

One thing I know will work is if I use foobar2000 to transcode to fresh mp3 files and bin the originals, though obviously not keen on doing that if there is another option. Any ideas/suggestions?
Title: Re: External Tags
Post by: Just_Addict on 2020-04-10 16:59:40
you might want to check if there's also ID3v1 tags in those files.
Title: Re: External Tags
Post by: Case on 2020-04-10 17:43:09
Thanks for notifying, @iridescentaudio - APEv2 reading had a bug that is now fixed.
Title: Re: External Tags
Post by: iridescentaudio on 2020-04-10 22:40:09
Aha, just like that... thanks for the fix Case. :)
Title: Re: External Tags
Post by: D.Sync on 2020-04-29 01:08:46
Found a bug where the External tags (folder.tags) won't be read if the foobar2000 instance crashed during tagging. Reopening and even rescanning the media library, and the Properties window still show tag from the file instead of the folder.tags

Luckily I only tagged 2 albums before foobar2000 crashed. And have to resort to recreate a new External tag again. Even copy / pasting the previous folder.tags to the new one still doesn't picked up by foobar.

Tested on foobar 1.5.3 without the need to set external tags reader priority. Not sure what is the cause. Strangely clicking Context Menu > Tagging > Edit External Tags can read the tags from folder.tags. But properties windows doesn't.
Title: Re: External Tags
Post by: hakadespra on 2020-05-04 14:15:25
I created external_tags for youtube streams that I added with foo_youtube, but I cannot find the created external tag file nor the sqlite file. Where are these?

EDIT: I found it...
Title: Re: External Tags
Post by: Case on 2020-05-05 18:23:12
Found a bug where the External tags (folder.tags) won't be read if the foobar2000 instance crashed during tagging. Reopening and even rescanning the media library, and the Properties window still show tag from the file instead of the folder.tags

Luckily I only tagged 2 albums before foobar2000 crashed. And have to resort to recreate a new External tag again. Even copy / pasting the previous folder.tags to the new one still doesn't picked up by foobar.

Tested on foobar 1.5.3 without the need to set external tags reader priority. Not sure what is the cause. Strangely clicking Context Menu > Tagging > Edit External Tags can read the tags from folder.tags. But properties windows doesn't.
You should use Reload info feature to force foobar2000 to bypass its internal metadata cache and reload the info from files. You can find it in the properties dialog's Tools button or under Tagging menu of the right click context menu if you hold down shift-key before you right click.

The player crashing isn't normal behavior. Hopefully you submitted the crash logs. If my components are the cause I want to get them fixed as soon as possible.
Title: Re: External Tags
Post by: D.Sync on 2020-07-11 00:47:43
Found a bug where the External tags (folder.tags) won't be read if the foobar2000 instance crashed during tagging. Reopening and even rescanning the media library, and the Properties window still show tag from the file instead of the folder.tags

Luckily I only tagged 2 albums before foobar2000 crashed. And have to resort to recreate a new External tag again. Even copy / pasting the previous folder.tags to the new one still doesn't picked up by foobar.

Tested on foobar 1.5.3 without the need to set external tags reader priority. Not sure what is the cause. Strangely clicking Context Menu > Tagging > Edit External Tags can read the tags from folder.tags. But properties windows doesn't.
You should use Reload info feature to force foobar2000 to bypass its internal metadata cache and reload the info from files. You can find it in the properties dialog's Tools button or under Tagging menu of the right click context menu if you hold down shift-key before you right click.

The player crashing isn't normal behavior. Hopefully you submitted the crash logs. If my components are the cause I want to get them fixed as soon as possible.

Thanks Case again for the reply. The occasional crash is indeed caused by other playlist viewer that I had in my skin, I am using a lot and had to disabled all of them and leave one on.

Not sure if others reported this before, but after using External Tags very rigorously since my last reply on stable foobar 1.5.3, I noticed that after moving files to a new location, some tracks (usually one) would lose the External Tags info and fallback to the file tags. And I had to Reload Info for the tag to shown properly. This happens on the latest foobar 1.6beta as well. So I have to keep in mind to Reload Info whenever I moved the files, and do a Reload Info on all my 3TB music lilbrary every months or so to keep all the tags in check.
Title: Re: External Tags
Post by: sammoth on 2020-09-20 11:54:30
I have some .mkv files where External Tags seems to take over tagging and create external tags overzealously. In particular it seems to happen when I run the Tag Sanitizer component on them. The tags on these files are able to be read/written to by foobar natively and when I don't have External Tags installed, I can run Tag Sanitizer on them and the files are correctly updated with some tags removed. However when External Tags is installed, running Tag Sanitizer will cause external tags to be created, after which the external tag takes priority over the file's tag. Maybe Tag Sanitizer is running some operation which isn't supported by the mkv decoder, but which isn't actually important?

Either way it would be nice to have an option to never automatically create external tags, ie. only read/write to ones created manually using the context menu, as at the moment this behaviour causes foobar to silently stop writing tag changes to those files without any notice.
Title: Re: External Tags
Post by: Case on 2020-09-20 15:09:42
Not sure if others reported this before, but after using External Tags very rigorously since my last reply on stable foobar 1.5.3, I noticed that after moving files to a new location, some tracks (usually one) would lose the External Tags info and fallback to the file tags.
This is a new report and I haven't seen this happening. Could you check the foobar2000 console after the file operations to see if the component reports any problems?

I have some .mkv files where External Tags seems to take over tagging and create external tags overzealously. In particular it seems to happen when I run the Tag Sanitizer component on them.
Thanks for the bug report, I could replicate it here. It was caused by the fallback album art tag writer creating an external tag from the file contents as soon as tag writer was opened. I changed the behavior so it only copies existing tags to external tag when the commit command is called and there is actual art data to store.

Either way it would be nice to have an option to never automatically create external tags, ie. only read/write to ones created manually using the context menu, as at the moment this behaviour causes foobar to silently stop writing tag changes to those files without any notice.
This should be unnecessary now that the bug is fixed. I hope you agree.
Title: Re: External Tags
Post by: sammoth on 2020-09-20 15:20:10
This should be unnecessary now that the bug is fixed. I hope you agree.

Thank you, that was fast! Yep I agree.
Title: Re: External Tags
Post by: Marnes on 2020-09-28 22:40:49
Lemme start by saying thanks for making this, and I'm excited to start using this to fix an age-old gripe I have with foobar/foo_midi that foo_mtags doesn't solve transparently enough :)

My collection includes some midis (and on occasion some exotic other untaggables). I'd like to store tags for such nontaggables in an identically named (plus ".tag" of course) file next to each audio file, rather than e.g. foo_midi's builtin sql and whatever similar features foobar has, mostly because I've experienced foobar or foo_midi losing a file's tags after file operations and such. I'd like tags on my nontaggables to not be foobar-internal but (as close as possible to) as robust and backupable as regular tags. I gather from a previous reply that exttags patches the file operations to keep each pair together, great!

I can't get it to do anything though, in foobar 1.6. I've configured this component (aside from the default "APE tags only") to always write external tags in the preferred format, and set the decoder order to

* unnamed legacy
* external tags (writer)
* midi player

Question at this point: isn't "external tags (writer)" a misnomer here? Seems to me it would be a _reader_ since it's in a list of decoders. Or is foobar misnaming them and are these components all two-way codecs?

Next, I went to a midi file (which still showed foo_midi's tags) and used the context command "rewrite file tags" on 1 track. Nothing happened. I also opened the properties dialog (showed the existing tags) and saved it, nothing happened. "Edit external tags" also just opens the existing foo_midi-stored tags in the properties dialog (duh, since there is no tags file).

So, long story short, my high-level question is: how should I go about setting this up to
1) migrate my existing midi tags from foo_midi to external tags, and
2) let external tags take over all midi tagging from then on?

I would assume this just takes calling "rewrite file tags" on all files, where exttags would first defer to foo_midi to read tags (since exttags finds no files) but take priority for writing, and from then on exttags would just own them for read and write.

Thanks :)
Title: Re: External Tags
Post by: Case on 2020-09-29 11:39:20
I'm short on time so only a quick reply for now. The decoder priorities are no longer that relevant as foobar2000 now has filter API for the component to use. To force your midis to external tagging select the files (do this on small test batch first), hold shift, right click one of the tracks and use command Tagging -> Create external tags. That will copy current metadata to external tags. Once a file has external tags all edits should go to those automatically.
Title: Re: External Tags
Post by: Marnes on 2020-09-29 13:09:41
hold shift, right click one of the tracks and use command Tagging -> Create external tags

Ah, hold shift as in for the extended context menu? I could've sworn I didn't see that command but this would explain that. I'll try it tonight, thanks!

... filter API... Once a file has external tags all edits should go to those automatically.

Excellent :))

I'll see if I can maybe add some things from this topic to the wiki page tonight, never edited foo wikis before, not sure if I'm allowed to or what. Thanks for the info.
Title: Re: External Tags
Post by: Marnes on 2020-10-01 15:30:35
The documentation link on the components repo is invalid, by the way. It should point to http://wiki.hydrogenaud.io/index.php?title=Foobar2000:Components/External_Tags_(foo_external_tags)
Title: Re: External Tags
Post by: Case on 2020-10-01 18:27:08
Thank you very much, the documentation looks great!

The original link was something the system automatically generates.
Title: Re: External Tags
Post by: Marnes on 2020-10-01 18:31:42
You're very welcome. I've been wishing for exactly this component for years, never dared to try and program it myself. I left a TODO in the page for you though, I can infer much about foo_ext_tags but not everything :p
Title: Re: External Tags
Post by: moonra on 2020-10-31 06:58:03
This might've been asked before and maybe I don't even need this component, but I think it's easier to ask. Can I use this to write a file with external tags to be used on foobar instead of the metadata already on the file? It's mostly for torrents that came with tags in a style I don't like or missing stuff [no Album Artist] but I don't want to mess with the metadata so it doesn't stops me from seeding it.

Or is there a better/easier way to do that? Thanks in advance!
Title: Re: External Tags
Post by: Marnes on 2020-10-31 11:14:13
@moonra it should. Do a test to make sure: make a copy of one of the files, create the external tags file for it, edit some tags and do a replaygain scan maybe, then check with a hashing tool if the copy and original still have the same hash. More info on the wiki: https://wiki.hydrogenaud.io/index.php?title=Foobar2000:Components/External_Tags_(foo_external_tags)#Usage

 You could also just set the files to be readonly through your file browser, then you can experiment all you want with peace of mind instead of a hashing tool.
Title: Re: External Tags
Post by: Fabcore on 2020-10-31 16:50:16
Yes, you can, make sure to config the external tags (writer) to be in the first list of priority in Playback>decoding preferences.
Or, in the context menu >tagging>edit (or) create external tags.


Title: Re: External Tags
Post by: Mrakobes on 2020-11-05 06:04:21
I tried to use the subj, creates a file in the target folder that does not run foobar2000, also creates it in ansi encoding, which makes it impossible to save Unicode characters, what are the advantages over m-tags???
Title: Re: External Tags
Post by: Marnes on 2020-11-05 09:57:19
I tried to use the subj, creates a file in the target folder that does not run foobar2000, also creates it in ansi encoding, which makes it impossible to save Unicode characters, what are the advantages over m-tags???
I can put unicode characters like 😀 into my ext tags just fine, and they even show correctly when I open the .tag file in my text editor (which you normally never need to do, mind you) with utf8 decoding.
Title: Re: External Tags
Post by: Case on 2020-11-05 19:15:49
I tried to use the subj, creates a file in the target folder that does not run foobar2000, also creates it in ansi encoding, which makes it impossible to save Unicode characters, what are the advantages over m-tags???
The tags are in UTF-8 format and very much support unicode. The advantage over m-tags is that tagging is handled transparently - the tags are usable in the player automatically without doing any extra work. You don't need to modify files manually or replace files in playlists with custom tag versions.
Title: Re: External Tags
Post by: Klaster_1 on 2021-03-06 07:46:17
Can the plugin emit external tags into files copied with "File Operations \ Copy to"? To clarify, I use External Tags to preserve original file integrity - mostly MP3 - intact and this works great on a PC. When I copy albums to a phone, file integrity becomes irrelevant but I still want to have proper tags because some files originally have none or very low quality metadata, so I'd like to re-use metadata kept in the SQLite instance. Version "1.0.20" release notes mention "external tag copying from the source file to the copy when using File Operations (only used for folder and APE tags)", does foobar2000 Android support "folder tags"? There also was some talk about it on page 9. Did I miss a setting somewhere?

On a side note, the SQLite instance seems to use file paths as keys. Given my files never change, is there a way to change the indexing to be more portable, like file checksum? Path indexes mean the tags are not preserved after the file was moved to a different dir, which is annoying.
Title: Re: External Tags
Post by: Mrakobes on 2021-03-06 11:09:32
Hello to the developer.

1. For some reason, I don't have a reader.

(https://i114.fastpic.ru/thumb/2021/0306/28/2fddf418904b63e62e011b4e51e7d928.jpeg) (https://i114.fastpic.ru/big/2021/0306/28/2fddf418904b63e62e011b4e51e7d928.png)

2. I really want to be able to edit the TAGS file using an external editor, for example, a text editor, how can this be implemented? How do I open a file to manually correct the tags? Including redcasting the cover

3. I can't set the file name using the usual syntax, for example %album artist%

4. Causes confusion identical windows with native ones

(https://i114.fastpic.ru/thumb/2021/0306/07/_ed96ba0a2a422dfc3d882a49654aca07.jpeg) (https://i114.fastpic.ru/big/2021/0306/07/_ed96ba0a2a422dfc3d882a49654aca07.jpg)

In the end, I would like a substitute for CUE with advanced features

5. I also want to understand that the topic header says "experimental" - hence the question - it makes sense to reformat your entire discography using your add-on, and what if you stop supporting it and the new version of the player is not compatible?

6. Also interested in the question of writing back to the tags of files CUT INTO SEPARATE tracks
Title: Re: External Tags
Post by: Marnes on 2021-03-06 11:21:01
1. For some reason, I don't have a reader.
2. I really want to be able to edit the TAGS file using an external editor, for example, a text editor, how can this be implemented? How do I open a file to manually correct the tags? Including redcasting the cover
3. I can't set the file name using the usual syntax, for example %album artist%
4. Causes confusion identical windows with native ones
In the end, I would like a substitute for CUE with advanced features

Not the developer, but...

1) as mentioned in the wiki (http://wiki.hydrogenaud.io/index.php?title=Foobar2000:Components/External_Tags_(foo_external_tags)#Required_configuration) this is normal on newer foobar versions.

2) the tags files are binary APE tags. You can edit them with text editors geared towards developers, but it's just not recommended to do so because it's easy to get some required binary characters wrong. You should edit tags through foobar. Once a file has exttags, the tags shown by foobar in the standard tags dialog you're familiar with (and all other tagging components) will be the exttags.

3) File Operations -> rename/move works perfectly for me, moving/renaming the files along with any tag files they may have, and foobar interprets filename variables in them. The operation preview won't list the tag files though, you just have to trust the component. What are you doing exactly that doesn't seem to work?

4) the point of exttags is that it stores tags differently but otherwise has identical behavior/handling to standard tags. It's totally transparent. Why do you want to have a visible difference between standard and ext tags?

If you want something that's more like cue files, perhaps m-tags (https://www.foobar2000.org/components/view/foo_tags) is closer to what you want. Its metadata files are recognized as separate files from the audio they reference, basically a playlist with metadata.
Title: Re: External Tags
Post by: Mrakobes on 2021-03-06 17:23:23
1. What does absence affect?
2. A binary editor .... hmmmm .. this is understandable, they can edit whatever you want, but))) I wanted to edit in a visual editor
3. (https://i114.fastpic.ru/thumb/2021/0306/e2/10dc6aae60752a6f474603ce6c7021e2.jpeg) (https://i114.fastpic.ru/big/2021/0306/e2/10dc6aae60752a6f474603ce6c7021e2.png)

4. For example, I want to double-click a cue file in the player, how to do it and quickly edit it as it does. Double-clicking from the explorer folder does not start playback, writes a syntax error (((

5. You understood me correctly, m-tags is suitable for these purposes, but it is not supported by the developer and messages hang for 2 years ... for example, I am maddened by the impossibility of saving to a folder with files, I have to constantly go through the whole path in the explorer - this is very inconvenient and other minor difficulties
Title: Re: External Tags
Post by: Case on 2021-03-06 19:06:54
Can the plugin emit external tags into files copied with "File Operations \ Copy to"?
External tag data gets copied to the copy automatically.

does foobar2000 Android support "folder tags"? There also was some talk about it on page 9. Did I miss a setting somewhere?
External Tags only work in the Windows version with the component installed. Apply the tag data to the files for portable use.

On a side note, the SQLite instance seems to use file paths as keys. Given my files never change, is there a way to change the indexing to be more portable, like file checksum? Path indexes mean the tags are not preserved after the file was moved to a different dir, which is annoying.
SQLite is not meant to be portable, the other two options write the tags data to the file location and they are portable by nature. Using path is the only 100% exact method to identify correct file and it's also the fastest identification method. If you use foobar2000 to copy or move the files the database is automatically updated.
Title: Re: External Tags
Post by: Case on 2021-03-06 19:18:13
3. I can't set the file name using the usual syntax, for example %album artist%
Titleformatting is not interpreted here. You should stick to the default name unless you have very good reason to use something else.
The whole point of folder tags is to contain all the tags of a directory in a single, easy to manage file.

The rest of your questions were nicely answered by Marnes. Frankly I don't really understand your Cue related questions. My suggestion would be to avoid anything cue sheet related unless you are actually burning an audio CD and need cues.
Title: Re: External Tags
Post by: Klaster_1 on 2021-03-06 20:17:52
External tag data gets copied to the copy automatically.
I went and checked again, the files are copied with original tags. There are new entries in the SQLite for copy target paths, was this what you meant? If yes, then that does not help with my use case at all, I'd like for copied files to have tags from the DB, to bake the tags in for portability.

If you use foobar2000 to copy or move the files the database is automatically updated.
This works indeed, thank you 👍
Title: Re: External Tags
Post by: Mrakobes on 2021-03-08 11:58:43
@Case The external tag file in my opinion should have a unique name for example

Metallica - 1999 - S&M (Live).tags

What does the absence of a reader affect?

And of course you want to be able to make adjustments to the tags file using an external editor...
Title: Re: External Tags
Post by: Mrakobes on 2021-03-08 13:42:00
also, in my opinion, the automatic creation of a tag file should be disabled, if the folder contains a track album, I am more satisfied when the tags are written to the flac file, but in the image, when there is a cue, the creation of a tag file is justified

A very big request, work with the context menu-combine all the items in one drop-down subordinate list, otherwise everything is scattered and you can not distinguish the commands of the player from the commands of the application, it is also inconvenient to work with shift, that is, with hidden items
Title: Re: External Tags
Post by: coldblood on 2021-07-21 14:35:26
For a bit of clarification, I would like to apply replaygain to my entire music library. The near total majority of it is in FLAC or MP3. The issue is I cannot afford to modify a single bit of any of those files. Having the replay gain tags stored externally is absolutely perfect, is this component something that can enable that? I've tested this  a tiny bit by setting my files to read only, then scanning with replaygain, which appears to work and apply the tags, then verifying the files and they haven't been altered. But I'd just like to know before I pull the trigger on the many hours needed to scan the whole lot :)
Title: Re: External Tags
Post by: Case on 2021-07-21 18:50:24
That should work perfectly with this component, @coldblood.
Title: Re: External Tags
Post by: coldblood on 2021-07-22 05:36:42
Awesome thanks Case.
Title: Re: External Tags
Post by: iridescentaudio on 2021-08-31 12:55:05
Hi, quick question, does anybody have any tips for cleaning up stray/orphaned .tag files, which have been left behind after audio files have been moved/deleted via processes outside of foobar2000 (e.g. Windows Explorer or duplicate file removal software)?
Title: Re: External Tags
Post by: neothe0ne on 2021-11-07 05:17:15
Is it possible to add an option to disable the automatic creation of the External Tag file if the audio file is marked read-only?
Title: Re: External Tags
Post by: Case on 2021-11-08 19:38:52
Is it possible to add an option to disable the automatic creation of the External Tag file if the audio file is marked read-only?
It is. New version with this option added is out.
Title: Re: External Tags
Post by: manmower on 2021-12-29 18:32:32
What are the scenarios in which external tags will automatically be created?

Just switched to this, from m-TAGS, to tag my radio stream URLs. It seems as soon as I opened the properties dialog for a stream, the external tags were created. Brilliant, but since that is all I need it for, I'd just like to be sure that I won't inadvertently create external tags for any other files. My search for documentation led me to the wiki (https://wiki.hydrogenaud.io/index.php?title=Foobar2000:Components/External_Tags_(foo_external_tags)) but I'm still confused as to how it works and when the tags will be auto-created.
Title: Re: External Tags
Post by: sveakul on 2021-12-29 20:42:56
When I look at Properties of a stream that I have not chosen to create an external tag for, one is NOT automatically created.  My External Tags settings look like this:

 (https://i.imgur.com/NIliKBw.png)

The fact that I have set it to only use APE tags may or may not be a factor, but be sure "Take over all tagging" is not checked.  Foobar 1.6.8, External Tags 1.5.12
Title: Re: External Tags
Post by: manmower on 2021-12-29 22:16:33
Well, I've tried to reproduce it, by first removing the external tags from one of the streams. It seems that merely opening the Properties indeed doesn't create them, it's when I make any changes to the metadata and apply them that External tags are created. So I don't know if I misremembered or what.

I'm on the same foobar2000 (1.6.8) and component (1.5.12) versions, and my settings are the same as yours except I've also checked the second to last option 'Disable automatic external tag creation when target file is read-only'.

The question is still more or less the same, I'd like to understand when my metadata changes will result in the creation of external tags. I assume that internal tags will still be the default for local files, I just don't see it explicitly documented.
Title: Re: External Tags
Post by: Case on 2021-12-30 05:57:31
All regular tagging will continue to work normally, be it a local file on your hard drive or a remote file on a network share.

Unless you enable the "Take over all tagging" option External Tags will only be created automatically when the track in question can't be tagged. Typically this would be a stream or an exotic audio format that doesn't support tagging. Or a regular audio file that is write-protected.
Title: Re: External Tags
Post by: manmower on 2021-12-30 08:40:59
Alright, sounds like there's nothing to worry about and I can just let the component do its thing!

Thanks for the reassurance, and for your work on this of course.
Title: Re: External Tags
Post by: sveakul on 2021-12-30 22:03:15
manmower:  the external tag for streams is only created automatically if you actually attempt to add tags to the stream;  just opening "Properties" from the context menu, and closing it, does not automatically create an external tag for a stream.  If the stream already has an M-Tag, I don't know what happens.
Title: Re: External Tags
Post by: iridescentaudio on 2022-02-07 13:28:53
Hi Case (or anyone else who can answer), quick question, is there a way to distinguish whether attached cover art is stored internally or externally? I often remove a cover, it doesn't work, then the penny drops that I need to first Commit external tags, and try again. I also prefer to store cover art in external tags; it would be nice to track down all of the files in my library that still have covers attached internally. I was thinking a %__covertype% field or similar could come in handy in both cases, if I'm not missing something. Thanks!
Title: Re: External Tags
Post by: Case on 2022-02-08 06:01:36
That isn't supported at least at the moment. If there's a simple way for me to implement that I can add it.
Title: Re: External Tags
Post by: Porcus on 2022-02-08 11:19:12
You probably have thought of this and found it not to be "a simple way", but if not, here's from some ignorant swiney snout who totally sucks at coding:

* Could be stored in a ZIP or 7z file with a different suffix (like fb2k-component does) and name each picture something like
0 Front = description.jpeg for common "front"
1 Back = description.jpeg for file 1's back that is not common to all
1 Front = otherdescription.=0 if file 1 uses the 0 Front file but a different description
etc.
* Using 7-zip (which is FOSS) you can probably duplicate files without size penalty, and accommodate "file names" as long as hell.
* One tagset per file rather than per folder? Easier.
Title: Re: External Tags
Post by: regor on 2022-02-08 11:41:01
I think the point is how to implement an exposed check to tags which should output true when it's an external tag and false when it's on file. And it should be query compatible (since that's the main aim)
Code: [Select]
$isExternalTag(artist)
BUT some entities are not a tag per se, like the cover, which has no TF variable. That would require another TF function for those specific cases (not sure if there are more than the cover).
Code: [Select]
$isExternalTagCover()

Then it further complicates its use with m-tags, since such function would only check if the tag is provided by the plugin, but it would not be 100% sure they are from the files (may be from m-tags). I suppose people use one or another plugin but its worth warning about it if such feature is aded.
Title: Re: External Tags
Post by: Porcus on 2022-11-10 09:04:04
A couple of observations using .tag files, none are a big deal.

* For files that have no tags at all, I can create external tags and remove external tags, but commit to file does nothing.
That is maybe OK to leave in as a warning?
* Every now and then, commit will "fail": having library search for %__tagtype% HAS xt while it is running, there will be some odd folder with a file left in the search. Yes sometimes the library is lagging and it "disappears" after a "Reload info from file(s)", but most often not.
I don't know if it actually gets as far as to writing tags to the audio files (i.e. only the removal stage fails).
No big deal: I just have to run it once again.

Tested right now on v2 64-bit, but I noted the second item for a long time.
Title: Re: External Tags
Post by: Porcus on 2022-11-10 16:30:35
Oh, and:
I discovered that failure to commit sometimes happens on part of a multi-track ("image") file.
Then the .tag file is gone nevertheless, so any tag updates are lost.
Title: Re: External Tags
Post by: Porcus on 2022-11-16 23:24:47
Hm. foo_external_tags and foo_renamer aren't always the best of friends, at least not on the EXFAT file system:
Old name:
AbBa_Eagle.mp3
AbBa_Eagle.mp3.tag
should be renamed to nearly the same, but the first "b" capitalized. Unfortunately, Windows (11) and EXFAT don't think I need to correct case, so a file could easily be reverted back.
But foo_external_tags is case sensitive, and then it doesn't recognize the .tag file.

Too bad to have to correct Microsoft's fuckups, but I guess that is part of the game when working on Windows.
(Feel free to shout back "yes, do that - avoid EXFAT!")
Title: Re: External Tags
Post by: Porcus on 2022-11-22 21:40:14
Need help which right now hopefully can save a couple of days' labour, if the following works - but I'm asking before firing up fb2k again.

* Hard drive crash [well maybe, I have not yet taken the chance of firing it up again] at the end of a major tag clean-up. Might have found some bad sector, or might have shut down as a safety precaution over running too hot.

foo_external_tags is installed.

Can I get these tags transferred to a backup drive (well the now-in-the-works copy of the backup drive) as follows
* Without connecting any drive, ask foo_external_tags to create (SQL) tags for everything, and then
* Connect a backup drive which has - with a couple of renamed exceptions that I will find - the same files (after making sure it identifies at the same drive letter), and
* Then have these updated tags from current database in foo_external_tags' SQL database, ready to commit
?

I probably need to disable fb2k's library rescanning at startup, and I probably need to do that before I fire it up?
Title: Re: External Tags
Post by: Case on 2022-11-23 13:21:34
I'm sorry I can't provide a perfect answer at the moment, but what you are attempting sounds doable. I'm still on the road and can't conveniently access my development machine. Remember that you can always backup your foobar2000 profile and all the cached info there remains intact. If the attempt doesn't work I can make adjustments to the component to make it possible.
Title: Re: External Tags
Post by: Case on 2022-11-23 13:26:39
I discovered that failure to commit sometimes happens on part of a multi-track ("image") file.
Then the .tag file is gone nevertheless, so any tag updates are lost.
That at least is definitely a bug. I'll take a look.

Hm. foo_external_tags and foo_renamer aren't always the best of friends, at least not on the EXFAT file system:
Old name:
AbBa_Eagle.mp3
AbBa_Eagle.mp3.tag
should be renamed to nearly the same, but the first "b" capitalized. Unfortunately, Windows (11) and EXFAT don't think I need to correct case, so a file could easily be reverted back.
But foo_external_tags is case sensitive, and then it doesn't recognize the .tag file.
If foo_renamer fails at file renaming I'll have to fix that. Thanks for letting me know.
Title: Re: External Tags
Post by: neothe0ne on 2023-01-15 04:40:58
Is it feasible to set up this component, or any other component, to only write specific tags to the external database, and continue writing all other tags to the audio file?  For example, to capture a tag field for a purchase receipt URL that I don't want to write to the audio file.
Title: Re: External Tags
Post by: Yakhobian on 2023-02-28 02:53:16
Thank you, Case, for this really useful plugin.
Are there plans to recompile this component to work with 64-bit Foobar 2.0?
Title: Re: External Tags
Post by: marc2k3 on 2023-02-28 02:57:50
https://foobar.hyv.fi/2.0/?view=foo_external_tags
Title: Re: External Tags
Post by: Yakhobian on 2023-02-28 09:48:14
https://foobar.hyv.fi/2.0/?view=foo_external_tags
Thank you for the resource. I'll keep it mind if an official release of the plugin isn't released before the final version of foobar2000 2.0. :)
Title: Re: External Tags
Post by: anamorphic on 2023-02-28 11:25:58
^ That is the official release, direct from the component home page by Case.
Title: Re: External Tags
Post by: Yakhobian on 2023-03-01 00:48:13
^ That is the official release, direct from the component home page by Case.
Thanks. I didn't realise that. I always just checked the official foobar2000 website for component updates and didn't see it there.
https://www.foobar2000.org/components/view/foo_external_tags
Maybe Case can put the latest version on that page?
Title: Re: External Tags
Post by: Porcus on 2023-03-01 07:49:52
If you check the fb2kv1.x edition of the component, that is the same version 1.5.12 on both Case's homepage and the official component page.

According to the changelog, new in 1.5.13 was "Changed the component to use SQLite bundled by the player." and that is v2.0's new library, so it does nothing to fb2k v1.x.
Title: Re: External Tags
Post by: Porcus on 2023-04-15 15:30:17
The following might be symptoms of something. Not saying they are more than nuissances, and especially for the first I suspect that work-arounds may even slow it down so much that the easy manual fix is a better solution:

* Committing tags to files sometimes fails. That is, I don't know if it is the commit part that fails, or deleting the .tag file.
I have taken note of it before, but now I "counted" when I did a mass commit of some 80k files (using the APE file tags, one .tag per file): and around a percent of them - eight hundred - still had external tags.
Possibly relevant: It did look like there were some one percent and a half, but fb2k hadn't discovered it: when reloading tags from files, a few disappeared from the query (I queried on %path% IS <pattern> AND %__tagtype% HAS xt). The "around a percent" is the figure after reloading - those that indeed still had the .tag file.

* Also, cf. the below thing: foo_renamer sometimes fails to rename the .tag file. How I provoked the error?
- Make a change to a tag that is part of foo_renamer's pattern
- Highlight a bunch of files, rename
- Take note that the renamed files don't have external tagtype; open it and see that names don't match
- Highlight and rename again; since the old name matched the file's tags, it would rename back
- Take note that the re-renamed file that has the old name, again has an external tag.

Actually, the reason I did the commit in the first bullet point story, was to safeguard against the second. I had made a major update after the incident in #358 (where foo_external_tags indeed helped an awesome lot, thanks!), so I had an extra level of backup temporarily and ... long story.

A likely-too-large-wishlist-item would be a functionality to "recover tags from unmatching filenames" - by matching on some pattern that includes track number I guess, or maybe customizable. Easiest to explain would be for folder.tags: a functionality that searches for a folder.tags file in the folder, and finds the entry that has the same track number. Say if I have fixed up a typo in album title, artist name or track title; still for the folder's track 3 (or 03) it can find back track 3 in folder.tags. For single .tag files it would have to traverse the directory looking for them. More job.

Now for this:

Hm. foo_external_tags and foo_renamer aren't always the best of friends, at least not on the EXFAT file system:
Old name:
AbBa_Eagle.mp3
AbBa_Eagle.mp3.tag
should be renamed to nearly the same, but the first "b" capitalized. Unfortunately, Windows (11) and EXFAT don't think I need to correct case, so a file could easily be reverted back.
But foo_external_tags is case sensitive, and then it doesn't recognize the .tag file.
If foo_renamer fails at file renaming I'll have to fix that. Thanks for letting me know.

I don't think that is so easy. Trying to manually rename a folder this way in Windows Explorer, just changing some characters between upper and lower case, just doesn't do the job. So to implement this, I think you would have to do as in the following example:
Want: rename foldER\filEName to Folder\Filename
Do: rename to Folder~`tmp´\filename and then rename the directory afterwards. Hopefully, if it is written to a new directory, then case changes in filename will be honoured.
But this would likely be a major slowdown. More efficient (but more job for you) would be to check if it has to be done.
Title: Re: External Tags
Post by: Case on 2023-04-15 18:09:24
Thanks for the issue reporting. I'm sorry I still haven't taken the time to fix these problems.

I suspect the files somehow get locked and the operations get canceled. At least anti-viruses are known to cause that. And I don't have proper error reporting in the component. I really need to add that along with a retry loop if file access is temporarily blocked.

I haven't forgotten about the Renamer issue either. My life has had some positive changes but they have unfortunately meant less time for foobar2000.
Title: Re: External Tags
Post by: Porcus on 2023-04-15 19:50:44
Ah! Whether or not it is the same reason why CUETools developent suddenly took a hiatus ... good for you :-D

For commit to files:
I was worried (well not really "worried", you get my drift ...) it could be due to fb2k not allowing the tag commit, that would be "bad" in the senses that it would be a symptom of something unfortunate going on between the component and fb2k.
If it is Windows Defender (the only antimalware thing in here on this computer) that protects the .tag/.tags file and it actually commits the tags to file, then I'd say it is just a nuissance that could be relegated to "Known issues [...]Solution: run again on the remaining files".

BTW, for documentation ... just in the event you feel you have time to think over it:
 * the menu item "Commit" doesn't say outright that it will commit & then remove - but I don't know if any actual users will miss that piece of information. We can always recreate, although "Commit and then commit the rest to be sure and then recreate because I really wanted commit and not remove" is a minor nuissance.
 * I don't know if there is any sort of documentation what the wrapper does and what it is good for. No big deal for me ... uh, presuming it doesn't do anything I really want, which I don't know because I haven't used it because I don't know what it does  ;) 
Title: Re: External Tags
Post by: fooball on 2023-04-28 12:02:33
Please somebody tell me whether this would work:

I would like to apply preset tempo adjustment to a few tracks, without the adjustment affecting the actual MP3 file.  If I install External Tags and make the .mp3 read-only, will writing to the TempoAdj tag then be diverted to the database file, and will fb2k continue to read the ID3 tags as well as the TempoAdj tag in the database?  I've read that all tag writes will go to the database, but I'll only be writing TempoAdj.
Title: Re: External Tags
Post by: fooball on 2023-04-29 00:36:20
Okay, so I tried it out and I see what it does (copy all the tags out to a database, if any tag gets updated).

So now what I want to do is nuke the changes to restore the tags as per the .mp3 file.  I tried deleting the external-tags.db file, but the changes to the tag contents persist.  Why?
Title: Re: External Tags
Post by: Case on 2023-04-29 07:12:01
Because foobar2000 caches metadata on its own and nothing in the player refreshed the info.
If you use External Tags component to remove the external tags by holding shift and using context command Tagging -> Remove External Tags it will update the core with the changes.
If you want to do things manually you will need to force foobar2000 to reload the changes. You can use Properties dialog (Tools -> Reload info) or playlist context menu Tagging -> Reload info from files.
Title: Re: External Tags
Post by: fooball on 2023-04-29 08:12:36
Because foobar2000 caches metadata on its own and nothing in the player refreshed the info.
If you use External Tags component to remove the external tags by holding shift and using context command Tagging -> Remove External Tags it will update the core with the changes.
If you want to do things manually you will need to force foobar2000 to reload the changes. You can use Properties dialog (Tools -> Reload info) or playlist context menu Tagging -> Reload info from files.
OK, thanks, that's opened up a whole new world - I had no idea about shift+rightclick (hardly intuitive!).

However, these seem to be "selection only" operations – is there a way to force fb2k to refresh its entire cache in one hit?
Title: Re: External Tags
Post by: fooball on 2023-04-29 08:30:27
???  Now the tag edits are going to the file and not the db!
Title: Re: External Tags
Post by: Cynic on 2023-04-29 12:00:52
Thanks for this component, Case.

A few questions:

1. Is it possible to force foobar to automatically *always* write external tags to SQL db and never to the audio files themselves (also never to any pre-existing .tag files)?

For example, is setting:
in advanced preferences enough? Or is the "Create External Tags" command still required for the initial external tags SQL db seeding?

2. When the above configuration is in effect and after all files in foobar's media library are already tracked by the external tags SQL db, will new untracked files added to the media library be automatically handled by the SQL db when editing metadata?

3. Finally, what about untracked files in a temporary playlist (*not* in the media library), is "Create External Tags" required? And will the external tags db remember those files forever or will they eventually be purged after the playlist is deleted?
Title: Re: External Tags
Post by: fooball on 2023-04-29 13:00:48
???  Now the tag edits are going to the file and not the db!
Or maybe as well as – I haven't checked.
Title: Re: External Tags
Post by: Cynic on 2023-04-30 00:51:17
A few questions:

[...]

Answering myself after some brief testing:


is enough to automagically direct all tagging operations to the SQLite database, even for new, untracked files. That covers my questions 1 and 2.
It is possible to override this with the "Edit file tags" context menu command.

As for question 3, my quick tests suggest that edits to files outside foobar's media library remain in the SQLite db indefinitely, or at least the automatic purge doesn't happen as soon as the next foobar startup.

Is there any periodic purge of obsolete entries (ie, files not currently reachable from the media library) in the SQLite database?
Title: Re: External Tags
Post by: fooball on 2023-04-30 09:05:02
Waveform Minibar (mod) gives user configuration over the format of the database index used for storing the track waveform.  I would find that useful for External Tags too.
Title: Re: External Tags
Post by: Porcus on 2023-05-13 12:00:38
Kinda too vague to be a feature request, kinda too vague to be a question about unintended behaviour - but maybe clarify that yes it works this way and yes it works as intended, so that it can be explained in the wiki article?

If the .tag file is modified outside foobar2000, then "Commit External Tags to Files" does not catch it - I need to reload info from tags first. (Similar about Renamer.)
I am not sure if this is intended behaviour or if there was any intention behind it. But copying .tag(s) is one way to synchronize a library, and then a .tag file will be overwritten from outside fb2k, and ... you get my drift.

On the other hand, not reloading did save me from a lot of work upon a crash - then the contents of the external tags were fb2k's database, apparently.

So ... keep  "Commit External Tags to Files" as is, and in addition a "Commit (reloaded) External Tags to Files" ... ?
Of course, there will be too many thinkable combinations: commit with or without deleting, commit with or without reloading, and Case has to author it and ... but anyway. Worth considering.
Title: Re: External Tags
Post by: Porcus on 2023-05-13 12:03:08
maybe clarify that yes it works this way and yes it works as intended, so that it can be explained in the wiki article?

That goes for album art handling too. It doesn't handle album art with .tag files - does it with database and/or ADS stored tags?
Title: Re: External Tags
Post by: Case on 2023-05-13 12:34:40
If the .tag file is modified outside foobar2000, then "Commit External Tags to Files" does not catch it - I need to reload info from tags first.
It works like the internal "Rewrite file tags" command. Commits the info it currently sees. That part works like I think it should. Would be scary if it wrote different data than you expected.
But it could be considered a bug that foobar doesn't detect that the metadata has changed when the .tag file dates are different. I see I have written functions to handle timekeeping of tags for all formats, but the code is currently not utilized. All file stats come from the actual audio files. I don't remember why I made it this way, it nothing appears to break I'll change this.
 
That goes for album art handling too. It doesn't handle album art with .tag files - does it with database and/or ADS stored tags?
Something else wrong with art handling, or same issue that externally added art isn't visible without reload?
Note that ADS support is identical to regular .tag. The ADS is accessed simply by using a different filename.
Title: Re: External Tags
Post by: Porcus on 2023-05-13 14:51:09
when the .tag file dates are different.
Might test. Is it modification date it will check? Best tested on NTFS?

As for art:
My .tag files don't contain the art. Never did, obviously: they are like a kilobyte or two. But I don't know how the component handles (or is supposed to handle) art when set to use database.

Note that ADS support is identical to regular .tag. The ADS is accessed simply by using a different filename.
Oh. Does that mean that one can manipulate those with a copy command?
Title: Re: External Tags
Post by: Case on 2023-05-14 10:47:41
Sorry I was unclear. I mean the component currently doesn't report tag update dates to the core. But if it did, foobar2000 should reload info if your copied tag files had different dates.

Art support with database works too. The art is stored as binary in the database.

I don't think ADS files work for your copying purposes. Normal copy commands don't seem to allow touching them alone. But when base file is copied the ADS streams automatically follow.
Title: Re: External Tags
Post by: MrMonkey on 2023-05-23 14:41:38
Can this component (or any component) be used to only set *specific* tags based on a pre-determined list?
I ask because I use auto-playlists based on tags. If I wanted to retag a bunch of files when creating a new auto-playlist, the entire audio file will be edited and, when I run a backup on my music files, the file will need to be recopied. If I could just set specific tags to an external file, I'd only have to copy that small file. Trying to save bandwidth, if possible.
Title: Re: External Tags
Post by: Porcus on 2023-05-23 14:46:01
Can this component (or any component) be used to only set *specific* tags based on a pre-determined list?
Not likely, but based on the "because" part: what stops you from using external tags first, and then when you are done with them, only delete - without touching the files themselveS?
Title: Re: External Tags
Post by: MrMonkey on 2023-05-23 19:10:55
Porcus: not sure what you mean by "done with them." Since the auto-playlists rely on current tag values, if I removed the external tags, the auto-playlists would change contents.

Maybe an example would help understand my use case. Let's say I was compiling Billboard Top 40 playlists: one auto-playlist per week. I create a tag called AT40_1970-01-03. I add that tag to each song in my library that was on the Top 40 that week, using the rank as the value of the tag. Later, when I compile the next week's playlist using tag AT40_1970-01-10, I'd add the new tag, likely to the same file(s). And so on. Every time I add a new tag, I'm modifying the file as far as data backup goes. If I could use external tags for specific tags only, I'd only have to backup the (smaller) external tag files.
Title: Re: External Tags
Post by: Porcus on 2023-05-23 19:24:01
Ah. I don't think you can select.
But, to note, .tag files aren't that big, as they don't hold pictures.
Title: Re: External Tags
Post by: regor on 2023-05-23 19:51:26
I agree setting specific tags to be external tags would be really interesting, for this use-case, overriding specif tags, backups, etc.

@MrMonkey would want to make you note your problem could be solved with a different workflow. Instead of relying on tags to create autoplaylists, you could create playlists with such files and just backup the playlists. I have in mind 2 options:

1-  My SMP manager covers that use-case. Since playlists don't have to be loaded within foobar, they don't clutter your UI. You can then have a category "Top 40 playlists", and create one playlist per week. Finally add the files to such playlists. At any time you can then load the playlists with the files, faster than using queries in fact.

You need a backup? Just backup the 40 playlists. You can even use XSPF format, to have playlists which can be shared (i.e. not pointing to specific files, but just anything that matches the title - artist).

You can also force playlists to tag your files, as soon as you add a item to it, in case you want to do so. There is also a playlist format named "Smart Playlist" (from Kodi) which would allow you to create a playlist using other playlists as source, so you could even mix those playlists easily...

2- Also, as far as I know, m-tags allow to create a "virtual" album which could contain your top 40 playlists. Just select your tracks, create album in m-tags, and name it like "AT40_1970-01-10". Then set as album artist "Various". The m-tag file would point to your physical tracks, but tags are applied only to the tag file.
Title: Re: External Tags
Post by: fooball on 2023-05-23 23:08:22
I agree setting specific tags to be external tags would be really interesting
Me too.
Title: Re: External Tags
Post by: fbuser on 2023-05-25 20:14:31
(or any component)
foo_sqlite can do this. In case of questions, please use the relevant thread for them.
Title: Re: External Tags
Post by: Porcus on 2023-07-24 12:33:09
I cannot tell what is expected behaviour from foobar2000 here, i.e. whether to blame the component or fb2k itself.

%last_modified% does not always seem to capture it when a tag update is done and only .tag files get new timestamps (while the audio files do not).
@Case , is this ... solvable?
Title: Re: External Tags
Post by: Case on 2023-07-25 14:10:46
I spent some quality time with the sources today. It looks like I can't really report tag times since version 1.5 as the filter interface doesn't allow manipulating that data. I'll see what can be done.

In the meantime here's a slightly amended version with highly improved error reporting: https://foobar.hyv.fi/foo_external_tags_1.5.14+.fb2k-component (https://foobar.hyv.fi/foo_external_tags_1.5.14+.fb2k-component).
Title: Re: External Tags
Post by: Porcus on 2023-08-06 10:26:16
* Also, cf. the below thing: foo_renamer sometimes fails to rename the .tag file. How I provoked the error?
- Make a change to a tag that is part of foo_renamer's pattern
- Highlight a bunch of files, rename
- Take note that the renamed files don't have external tagtype; open it and see that names don't match
- Highlight and rename again; since the old name matched the file's tags, it would rename back
- Take note that the re-renamed file that has the old name, again has an external tag.
Seems that this happens when foo_renamer renames the directory. Then the .tag file isn't renamed accordingly. Of course, changes that affect my directory names, don't always affect filename, and in that situation the filename will match afterwards.
Title: Re: External Tags
Post by: Case on 2023-09-10 12:14:13
Hm. foo_external_tags and foo_renamer aren't always the best of friends, at least not on the EXFAT file system:
Old name:
AbBa_Eagle.mp3
AbBa_Eagle.mp3.tag
should be renamed to nearly the same, but the first "b" capitalized. Unfortunately, Windows (11) and EXFAT don't think I need to correct case, so a file could easily be reverted back.

I didn't realize it took me this long, but I finally got back to this issue.
Thankfully Windows file system API can report when case sensitive names are not supported, seems to at least be true for FAT32 and ExFAT.

I released a new foo_renamer (https://foobar.hyv.fi/?view=foo_renamer) that uses a workaround when renaming files on such volumes (renames them temporarily to a slightly different name).
I also added the component to the repository: Renamer (https://www.foobar2000.org/components/view/foo_renamer).
Title: Re: External Tags
Post by: eamatag71 on 2023-09-22 08:33:15
Hi
I've a big trouble with external tag.
After I used this component to store a tag the %samplerate% and %bitpersample% values of DSD become wrong...I tryed some workaround but I never succeed...I also tried a fresh installations, but...after usign externa tag....error rose.
If I playback the dsd file occurs tha proprerty dialog shows mewrong value, but the real time data becomes right...it's very strange...see the attachement...
Somone can solve this trouble?
Title: Re: External Tags
Post by: Case on 2023-09-22 09:09:36
External Tags shouldn't be able to alter the decoder information. I already asked you in the other thread to reload information from the files. In the screenshot there you see the "Tools" button at the bottom of the Properties dialog. Click it, and select "Reload info".
Title: Re: External Tags
Post by: eamatag71 on 2023-09-22 09:19:38
If I force a full realoding info I can see the correct value. I selected all the dsd file, asked for properties and reloaded infos for every file...it works!
Title: Re: External Tags
Post by: Case on 2023-09-22 09:22:28
As expected. I see now that among all the noise in the other thread you came to the conclusion that External Tags alters the display of the values. I don't see that happening here. Do you have multiple DSD decoders installed?
Title: Re: External Tags
Post by: eamatag71 on 2023-09-22 10:18:32
No, only SACD input.
Title: Re: External Tags
Post by: Case on 2023-09-23 11:34:33
Ok, managed to replicate the issue. foo_input_sacd has hacks in it, it alters its behavior based on context. It for example attempts to work differently when used in Converter. I don't know what it thinks is happening when called by foo_external_tags, but it doesn't want to return file properties but PCM output properties. And for some reason it's super broken here in my test setup and returns 0 for sample rate.

foobar2000 has a lot of new interfaces. I might be able to work around bugged inputs like foo_input_sacd returning nonsense, but it would mean a lot of re-engineering for me. Part of me wants to do it, but I worry it's a lof of work for little benefit. And possibly wasted effort.
Title: Re: External Tags
Post by: jwshields on 2023-11-20 22:29:45
I have an idea/suggestion for the component, it would be neat if there were an option to write the saved external tags to the file (if the format supports it)
Example, I have a number of badly tagged scene releases, use another component to get the metadata off of Discogs, and use this component to write the "Proper" tags & Metadata separately without modifying the original file. There's some files where I'd like to "export" these external tags and modify the file itself.
Would that be possible/reasonable?

Tangentially, I didn't see this on the foobar component page, your homepage, or in this thread, but is this plugin OSS? I'm not all that familiar with C and don't know the foobar SDK, but would be interested in helping out if possible.
Title: Re: External Tags
Post by: Porcus on 2023-11-20 22:49:17
You mean commit the external tags to file? Yes you can. But then it will delete the external tags, so you have to commit and then create. Use shift and right-click, that gives you more complete options and actions.

What can only be done file by file (I think?) is to commit only some of the tags. Then you have to copy them, then select the edit file tags, paste and save.
Title: Re: External Tags
Post by: Wolverines on 2023-12-20 23:17:02
I've spent hours going through this entire thread and still can't get artwork to display on internet streams. I'm not getting any errors either, so I have no way of knowing why. Using Foobar v2.1 x64 and External Tags 1.5.14, SQL db only.

The db gets written and the artwork retained, it just doesn't display. This method looked promising but it doesn't work either.
https://hydrogenaud.io/index.php/topic,116141.msg963903.html#msg963903 

I haven't bothered trying to use urls for artwork, only locally stored jpgs.

I have tried reloading info and closing/opening FB over and over. No joy.

On a side note, wouldn't it be easier to make FB use m3u extensions like this: #EXTINF:-1, logo="cover.jpg", Stream Name, instead of a complicated component that doesn't seem to fully work? I tried adding logo="cover.jpg" to my #EXTINF lines and FB just ignores it, even though the titles display fine.

I don't mean to denigrate the author's hard work, I'm just frustrated af. This is something that should be incredibly simple and built into FB, yet it isn't.

For reference, here's the streams I'm using. I have many others, but there's no point in trying with them until the problem is solved.

Code: [Select]
#EXTM3U
#EXTINF:-1, 80's Hair and Hits
https://ais-edge102-live365-dal02.cdnstream.com/a36545
#EXTINF:-1, America's Greatest 80's Hits
https://ais-edge104-live365-dal02.cdnstream.com/a18506
#EXTINF:-1, Classic Rock Planet
https://ais-edge104-live365-dal02.cdnstream.com/a80053
#EXTINF:-1, KFlash Classic and Hippie Rock
https://ais-edge101-live365-dal02.cdnstream.com/a11112
#EXTINF:-1, The Hippie Shack
https://ais-edge101-live365-dal02.cdnstream.com/a98816
#EXTINF:-1, The Outlaw
https://ais-edge105-live365-dal02.cdnstream.com/a03843
#EXTINF:-1, WSKY Country Radio
https://ais-edge101-live365-dal02.cdnstream.com/a90551
Title: Re: External Tags
Post by: sveakul on 2023-12-21 01:28:27
The method you linked to in the old Forum post I made still works for me with Foobar v.2.1 x64 and External Tags 1.5.14, however I have always had the latter's options set as "Use only APE tags."
Title: Re: External Tags
Post by: Wolverines on 2023-12-21 02:06:13
Just tried that. Had to re-add the logos for each feed since reloading info removed the "cover" field. Guess it wasn't getting saved to the SQL db after all.
Got it switched to only ape tags now, the .tag files are created, but there is still no artwork displayed after restarting FB.

I forgot to mention this is a fresh install of Fb v2.1, upgraded from v2.0 just last night, and v2.0 was installed fresh just days ago. Previously I was using a portable install of a much older x32 version, so I deleted that entirely before updating to v2.0 just to eliminate anything being left over.
Title: Re: External Tags
Post by: sveakul on 2023-12-21 02:32:21
I'm only using it for locally stored jpg's not URL logos so can't comment there.  My options are as below:

(https://i.imgur.com/TP6ZR5B.png)
Title: Re: External Tags
Post by: Wolverines on 2023-12-21 02:41:20
The option I didn't have checked is Always write external tags in preferred format, but it's checked now. I also uninstalled/reinstalled the component, since I saw where that made things work for others in this thread. Deleted the db files and .tag files as well. Set it up from scratch again. Still nothing.

I just don't understand why it won't work.
Title: Re: External Tags
Post by: Case on 2023-12-21 04:55:52
There's nothing wrong with adding images to SQLite database. Did you follow the stream tagging instructions to put the url in a wrapper? https://hydrogenaud.io/index.php/topic,116141.msg963852.html#msg963852 (https://hydrogenaud.io/index.php/topic,116141.msg963852.html#msg963852).
Title: Re: External Tags
Post by: Wolverines on 2023-12-21 08:14:42
Yes, I tried doing it that way first. It didn't work, so I tried the method in Reply 87 which says it's not needed. Unforunately, that didn't work either.

EDIT: Just tried the wrapper method again, and it sort of worked. Added a cover to one stream, but now it shows for all 7 streams in the m3u file I posted, even when not playing. I continued with the rest of the streams, each getting their own cover, but only the first one shows, again, even when not playing.

EDIT2: Added a cover in a different playlist, in this case one with multiple TuneIn Radio streams for a single station, and it's the same thing, The proper image displays for every link in the playlist, even though I only added it to the top link.
Seems this component doesn't properly account for multiple streams in a playlist, instead it applies the first image assigned to the entire playlist and ignores any others added afterward.

EDIT3: To test this, I removed the cover I assigned to the first link in the playlist, and left the other 6 alone. Closed/opened FB, and sure enough that one cover is gone, but the other 6 do not display, even though they are still shown in the properties for each stream.
Title: Re: External Tags
Post by: Case on 2023-12-21 12:25:47
I just tried both methods with both Default UI and Columns UI. Each stream shows the artwork I specified for them.

Are you using some very custom UI that combines all the streams into one "unit" and can only handle single artwork for said unit?

Without using the wrapper you have to follow the instructions quite precisely. The tag field you choose to use, for example COVER, must only contain the filename or part of the filename. If you try to include paths there it won't work.
Title: Re: External Tags
Post by: Wolverines on 2023-12-21 16:42:00
I am using Columns UI but there's nothing custom about it other than the addition of a Lyric Show 3 panel. I have not installed any of the Columns UI additions.

Using the <COVER> field doesn't work at all, and does contain only the file name, as the path to the covers is set in Preferences > Display > Album Art > Front Cover tab with the following path: D:\Programs\Foobar\Art\%COVER%. And for good measure I moved it to the top of the list.

Forgot to add: I had a hell of a time adding covers to every stream I have. The option to wrap for external tags would not show up on any stream until I created external tags without shift right clicking on them. Even then, sometimes I had to add a cover and remove it before the wrap for external tags option would show up.
Title: Re: External Tags
Post by: Case on 2023-12-21 18:10:37
Sounds like you are using album art display in playlist then. If you haven't tweaked settings or added more custom tags to the streams you no doubt notice that the streams are all in the same group in the playlist. The in-playlist album art viewer shows the same art for each group.
You can add a separate art viewer panel that shows art for the playing item or selected item. Or you can tweak the Columns UI grouping in Preferences -> Display -> Columns UI -> Playlist view -> Grouping tab.
For example to treat all http or https streams as separate groups you can change the default Groups string into this:
Code: [Select]
$if($left(%_path_raw%,4),http),%path%,$if2(%album artist%,<no artist>)[ / %album%])
Title: Re: External Tags
Post by: Wolverines on 2023-12-21 19:48:32
Your string sort of works. I've attached 2 shots before and after your string.

The Before shot is using the default string.
Code: [Select]
$if2(%album artist%,<no artist>)[ / %album%]

Maybe I'm wrong, but I thought I could have it look like the Before shot, while having the cover change depending on which stream is selected. Might still be possible, I'll have to play with it to clean it up and tweak it to my liking. I noticed when adding your string there's an option for Playlist Filters that might also come into play since the playlist shown is the only one with different stations in it.

I'm also going to try removing the default art viewer and add an artwork view panel. Tried that before but couldn't get it placed where I wanted it, and ended up having to restore my config.

Thank you.

EDIT: Removed the string entirely, added the artwork view panel, and assigned covers to every feed. Works good. Covers only show when a stream plays, rather than as selected, but I can live with it. New pic attached.
Title: Re: External Tags
Post by: Case on 2023-12-21 20:44:49
The grouping string I posted earlier is nonsense, sorry about that (this has been a long day...).
Here's a fixed string that does what I meant it to do. That is, to have each url in a different group, otherwise use the default grouping:
Code: [Select]
$if($or($strcmp($left(%_path_raw%,13),'exttag://http'),$strcmp($left(%_path_raw%,4),'http')),%path%,$if2(%album artist%,<no artist>)[ / %album%])

The album art support inside a playlist is for a group. It's meant to show album art for an album. It doesn't make sense for the playlist viewer to support it randomly changing for different tracks of the album. Your solutions are to have each radiostation in their own group or to show the image in a panel outside the playlist.
Title: Re: External Tags
Post by: Wolverines on 2023-12-21 20:55:13
Your new string produces the same result as your first one. but that's ok. I just found where I can change what's displayed in the artwork view panel, so it shows what's selected, which is what I wanted all along, so it looks like I've now got Foobar configured to my liking. It was a pita, but it's finally done. Never really bothered tweaking it like this before.

Thank you, Case, and everyone else here.

BTW, it's been fascinating seeing your component develop through the course of this thread.
Title: Re: External Tags
Post by: RedSaint on 2024-01-08 06:47:45
Niiice! This is exactly what I was looking for! I was originally recommended m-tags, but seeing as that is kind of dead and not expecting a 64-bit version of that component, it's nice to see that someone else has made a better and more feature rich alternative. 
Great documentation, although it would be nice if the location of the SQLite DB was listed somewhere as I'm sure people would like to back it up from time to time. Heck, maybe having a secondary backup location feature would be neat, i.e. like automatically backing it up to a USB stick when closing Foobar2000. 

Great work on this!


EDIT: I did find the location. It's %appdata%\foobar2000-v2\external-tags.db for anyone wondering

EDIT2: PS: Is there any configuration that'd make it possible to only use the SQLite option when saving replaygain tags, and use 'normal' tag writing for everything else?
Title: Re: External Tags
Post by: fooball on 2024-01-08 10:27:09
Is there any configuration that'd make it possible to only use the SQLite option when saving replaygain tags, and use 'normal' tag writing for everything else?

Make that any user-specified selection of tags: I would like to store tempo_amt separately.
Title: Re: External Tags
Post by: Case on 2024-01-08 11:22:30
I was under the impression that SQLite Utilities (https://www.foobar2000.org/components/view/foo_sqlite) allows you to do that.
Title: Re: External Tags
Post by: fooball on 2024-01-08 11:25:21
I was under the impression that SQLite Utilities (https://www.foobar2000.org/components/view/foo_sqlite) allows you to do that.
It might well do, I haven't got that far yet.
Title: Re: External Tags
Post by: RedSaint on 2024-01-09 00:16:39
I was under the impression that SQLite Utilities (https://www.foobar2000.org/components/view/foo_sqlite) allows you to do that.

Good tip. Will look at this tomorrow, looks promising!
Title: Re: External Tags
Post by: Azuriye on 2024-01-09 13:39:27
Hello, @Case could you have a look at this issue?
https://hydrogenaud.io/index.php/topic,110516.msg1037557.html#msg1037557

Do you know if it's an issue with the plugin or how fb2k writes to stream tags?
Title: Re: External Tags
Post by: Case on 2024-01-09 15:33:23
I had already checked it out when I noticed the comment in the other thread. Stream pauses briefly even with a clean foobar2000 install without any additional components when tagging attempt is made. I don't see External Tags doing anything to the stream in the code, it appears to just humbly write the external tag when it gets the information.
But Peter has been notified about the issue. Perhaps the behavior can be improved.
Title: Re: External Tags
Post by: Azuriye on 2024-01-10 09:32:35
Thanks a lot for the update, hopefully, it gets resolved.
Title: Re: External Tags
Post by: Nordfinn on 2024-01-11 21:20:46
I've spent hours going through this entire thread and still can't get artwork to display on internet streams. I'm not getting any errors either, so I have no way of knowing why. Using Foobar v2.1 x64 and External Tags 1.5.14, SQL db only.


Wolverine--  I haven't read through all of the above, but want to share what's worked for me, for some years now.  It's the below script in the "Album art" "Search patterns" box.  The fourth line begins the script that is specific to radio streams.  Perhaps you can parse it: It specifies a folder where my "RadioImages" are stored, and so long as the individual images are named with exactly 11 characters (maximum) that correspond exactly to the name of the stream that you give with External Tags, the art will be loaded when you play the stream.  The fifth line specifies a default image, if you have not designated one specific to a stream.

Works well for me.  N.

front.jpg
%filename%.jpg
%album%.jpg
$if($strstr(%path%,'://'),C:\ProgramData\Foobar\RadioImages\$trim($cut(%title%,11)).jpg)
$ifequal($strcmp($left(%path%,5),http:),1,C:\ProgramData\Foobar\RadioImages\radio.jpg,)
folder.jpg


Mod edit: fix quote tags
Title: Re: External Tags
Post by: Porcus on 2024-01-21 12:14:57
A little update after running a commit with fb2k 2.1.1. It is hard to pinpoint which issue is due to the component and which is due to fb2k.
External tags version 1.5.14+.

* There are still leftovers where the external tags are not committed. Maybe not that many?
* Resolved: There used to be "leftovers" where the tags were committed, but fb2k didn't notice it: that is, run a reload from tags, and the number of leftovers would be reduced. I found nothing such by now.

* But: fb2k doesn't detect the tag type at all. If I want that information I have to reload info from tags on the entire selection afterwards.
(I could of course exclude FLAC, where that info is never shown.)
Title: Re: External Tags
Post by: Case on 2024-01-22 06:54:21
For the leftovers, is there anything written to the console? I added more error logging for that version.

Apart from external tag commit losing tag type field, it has bugged me that the component loses creation date in both external tag creation and commit without info reload. When I have more time to dig into this I want to get these shortcomings fixed.
Title: Re: External Tags
Post by: Porcus on 2024-01-22 10:53:27
Doesn't look like anything was written - apart from the two files that were read-only, which is a completely different issue, but which shows that at least the logging was in place.

I also tried to reproduce it now, with some 7500 mp3 files. That should be more than enough to trigger it, but it didn't - so here is a conjecture: issue shows up when it is taking too long on a file due to full rewrite.

But the leftovers aren't a big thing to someone who either uses external tags "on all or on none". I could easily search for %__tagtype% HAS xt or not, and force re-read or another commit.
Bigger is to have to do a re-read on the entire collection. (Which in my situation happens upon yearly maintenance ... and upon testing.)
Title: Re: External Tags
Post by: Porcus on 2024-02-06 21:43:49
foo_external_tags saved me days' work again (scenario like below) - thank you!

Vague "request" for a recovery feature, let me explain it in terms of a folder.tags file:
* File includes a list of filenames and their respective tags.
* If I have to recover tags, then filenames may have changed.
So: function "try to match files (in the same folder) by track number" and maybe even easier: "try to match files (in the same folder) by file names in ascending order" - the latter would save it if files are untagged but named Artist Year Album 01 blah blah.flac etc.

This also is relevant when a renaming goes wrong, cf. other comments in this thread.

Of course, since you are also developing foo_audiomd5, then one could match by that tag too. At least in the same folder, then in most cases there should be no dupes. Although there are exceptions where an artist has put the same track as intro and outro, for example.


Need help which right now hopefully can save a couple of days' labour, if the following works - but I'm asking before firing up fb2k again.

* Hard drive crash [well maybe, I have not yet taken the chance of firing it up again] at the end of a major tag clean-up. Might have found some bad sector, or might have shut down as a safety precaution over running too hot.

foo_external_tags is installed.

Can I get these tags transferred to a backup drive (well the now-in-the-works copy of the backup drive) as follows
* Without connecting any drive, ask foo_external_tags to create (SQL) tags for everything, and then
* Connect a backup drive which has - with a couple of renamed exceptions that I will find - the same files (after making sure it identifies at the same drive letter), and
* Then have these updated tags from current database in foo_external_tags' SQL database, ready to commit
?

I probably need to disable fb2k's library rescanning at startup, and I probably need to do that before I fire it up?
Title: Re: External Tags
Post by: Porcus on 2024-02-14 07:58:52
A little update after running a commit with fb2k 2.1.1. It is hard to pinpoint which issue is due to the component and which is due to fb2k.
External tags version 1.5.14+

Tried with a library that does not monitor for changes, and nearly everything is fine. (New fb2k version 2.1.2, fresh portable install, same external tags version).
* All commits are actually committed
* Only that appear as leftovers and need to be refreshed: Matroska with chapters, track numbers 2 ff.

No urgent need for bugfixes, just thought I'd test and report.
Title: Re: External Tags
Post by: Azuriye on 2024-03-22 15:12:41
Hello, I seem to have something about web streams as well... is it possible for foobar2k to display images from a URL hosted on the internet without downloading? if it does how do you go about attaching image urls to a web stream? If you did notice foobar supports album art from web streams which send them through the stream and it doesn't download the radio station's album art and displays it on the cover art panel just fine.
Title: Re: External Tags
Post by: marc2k3 on 2024-03-22 16:41:20
is it possible for foobar2k to display images from a URL hosted on the internet without downloading?

Erm....

Quote
If you did notice foobar supports album art from web streams which send them through the stream and it doesn't download the radio station's album art and displays it on the cover art panel just fine.

I have no idea what you're asking with regards to external tags/attaching but I will say images displayed in album art panels do come from a url. The SDK provides an API to grab the image in memory and the url as a string. I use it in JSP3 and http/https image urls are displayed as tooltips when listening to stream like this one...

http://stream-uk1.radioparadise.com/aac-320

See attachment...
Title: Re: External Tags
Post by: Azuriye on 2024-03-22 19:20:05

I have no idea what you're asking with regards to external tags/attaching but I will say images displayed in album art panels do come from a url. The SDK provides an API to grab the image in memory and the url as a string. I use it in JSP3 and http/https image urls are displayed as tooltips when listening to stream like this one...

http://stream-uk1.radioparadise.com/aac-320

See attachment...

My bad, I got it confused it with following tutorials for tagging web streams with images so I assumed it's something which you need m-TAGS or External Tags to deal with... Thanks for linking however.