# Hydrogenaudio Forums

## 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?

p/s
Thanks for your persistence, diligence and work!
Title: Re: External Tags
Post by: Sergey77 on 2018-10-21 14:02:38
for testing:
Spoiler (click to show/hide)
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
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.flachttp://radio-paralax.de:8000/;9623928300546054stream.nsvhttp://relay-chi.gameowls.com/all.ogg?1:iXuQ4MxIpyhttps://radio.kamchatkalive.ru:8103/chillout
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:
• Select a song on the playlist, right-click and choose Tagging > Edit external tags.
• Add a new tag, let's say BPM and give it a value.
• Use Tagging > Reload from file
• Now invoke Tagging > Edit external tags again. You will not see the BPM tag that was added in Step 2, but if you right-click and choose properties the value is there.

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.

• Load one or more songs that have no external tags, whatsoever, in foobar. All tags of these songs are embedded in the actual files and only there (a very typical scenario).
• Now use the context command "Edit file tags" to change something. Maybe erase a tag or add a new one. I am assuming here that the "Edit file tags" command is supposed to be writing tags in the file. As an example, see image below, where I am adding the tag "Context" with a value of "Party"
(https://i.imgur.com/u2thlYO.jpg)
• Click apply. When I do that, the tag disappears as below (this does not make sense to me).
(https://i.imgur.com/eyfAFDS.jpg)
• Close the properties dialog box and use the context command "Tagging > Reload Info from file(s)". The effect of this is that the newly entered tag now appears in Playlist view, as below:
(https://i.imgur.com/f0anzWu.jpg)
• Finally, repeat step 2, that is, use again the context command "Edit file tags" to bring up the Properties dialog box. The tag is not there. I see again image 2, even though Playlist view shows the tag
• Restart foobar, the tag now shows everywhere, both in Playlist view and Properties dialog box.

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:
• 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.

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: 1Unable 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.
SimplePortal 1.0.0 RC1 © 2008-2020