Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: External Tags (Read 126627 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: External Tags

Reply #475
The tagging problem in 3) was because of the url length combined with bug. Even though filesystem supports tens of thousands of characters long paths, individual components of the path can't exceed 255 characters. I knew this and truncated the name to 255 chars, but then went and added the ".tag" extension so it became too long again.
This is now fixed. I also made it cut the the file name at question mark, so the length is much more reasonable. And will get matched even if the client key or other custom parameters in the url change.
I didn't want to bump version number yet as there have been various test builds made for Porcus and I don't want to get confused with my internal development version, so I just released a hotfix here: https://foobar.hyv.fi/?view=foo_external_tags.

4) was a caused by TPS giving up scanning streams that provided data slower than my test streams. That is now fixed in refreshed True Peak Scanner preview.

Edit: I just noticed I managed to get wrong month in the External Tags hotfix version string. It claims to be from the future, 2025-04-28. I should have left this for tomorrow.

Re: External Tags

Reply #476
url length. This is now fixed. I also made it cut the the file name at question mark, so the length is much more reasonable.
Problem I had was solved.

The cut off at the question mark does introduce a new issue:
$strstr(%path%,classic.nl/streams/?s=main)
$strstr(%path%,classic.nl/streams/?s=opera)
$strstr(%path%,classic.nl/streams/? s=mindradio)
$strstr(%path%,classic.nl/streams/?s=soundtracks)

The 4 stations now all point to the same external tag:
https___classic.nl_streams_.tag

instead of the ones of the previous version:
https___classic.nl_streams__s=main.tag
https___classic.nl_streams__s=mindradio.tag
https___classic.nl_streams__s=opera.tag
https___classic.nl_streams__s=soundtracks.tag

I attached the FPL with the four culprits.
Please fix.

4) was a caused by TPS giving up scanning streams that provided data slower than my test streams. That is now fixed in refreshed
TPS is working fine after your latest fix.

I do have one issue with TPS:
I have all streams grouped together in a playlist with is reflected in my playlist viewer ELP. I use replaygain set to album/track by PBO.
When I scan more than one stream with TPS, TPS is writing average values for it's ALBUM specific tags.
So I had to scan all streams one by one to make sure ALBUM values are the same as TRACK values.

Can you please change behavior of TPS so that TRACK values are forced to ALBUM values when the scanned item is a stream?

The APE tag type uses the built-in tag writer from foobar2000 and it doesn't seem to write the 'icon' cover. It looks like a foobar2000 bug, I have pinged Peter about it.
Thx.

Point 2) has been discussed in this thread. For some reason foobar2000 doesn't query art at all for these tracks so External Tags can't give the art. There have been discussions about various workarounds, easiest by far is to use the "Wrap for External Tags" feature of External Tags. That makes the stream url fully handled by the component and album art gets queried and can be shown.
I'm trying to get Peter to change foobar2000 behavior so workarounds wouldn't be needed, but so far this is the only way.
Don't know exactly what you mean, but it is working now for streams with external tags too in $albumart and the likes.
See below ...

Hold shift+right click, then selected 'Tagging' -> 'Create External Tags'.
Now shift+right the items again and select 'Tagging' -> 'Wrap for external tags'. This changes the urls to include a protocol that forces them to be handled by External Tags.
Now you can scan them with the above linked True Peak scanner and tag writing won't error out.
If you don't like the wrapping to be "permanent", you can create a new temporary playlist of the items and do the operations there.
I followed your guidelines to prepare streams in batches of 10/15 for external tagging.
Ran TPS (which also led to the ALBUM issue :-) ), than added %station% and added art per station.

Much to my surprise after restarting foobar art for streams was not visible in properties where the tag files according to file size clearly had the art embedded.
Then I rescanned all streams one by one to fix TPS ALBUM values.

So all streams already had external tags.
When I selected 'Wrap for external tags' once more all of a sudden the earlier attached art started appearing and is also available elsewhere (JS3, TF-PSS and TF-ELP).

The only thing I had to change in JS3, PSS and ELP was stream detection since the beginning of %path% has changed from 'http' to 'exttag://http'.

The (manual) addition of %station% in the external tag works beautifully, because the stream name is now always available in JS3, JSP, PSS and ELP regardless whether a stream is playing or not and regardless of the selection mode NowPlaying / Follow selected track (which you cannot change in TF itself).
I really do not understand why TF has not have this implemented by default.

I am also adding a field %stream_swap_artist_title% because some streams mix those up when playing.

Really good solution this external tag stuff.

Sorry for the long text.
Thanks.

Re: External Tags

Reply #477
The cut off at the question mark does introduce a new issue:
$strstr(%path%,classic.nl/streams/?s=main)
$strstr(%path%,classic.nl/streams/?s=opera)
[...]
The 4 stations now all point to the same external tag
I should have known some stations actually need this. I uploaded a new hotfix at https://foobar.hyv.fi/?view=foo_external_tags that only truncates at question mark when required by length. Hopefully this allows everything to work correctly.

I do have one issue with TPS:
When I scan more than one stream with TPS, TPS is writing average values for it's ALBUM specific tags.
I don't need to add special workarounds into TPS for this. You are supposed to use the "scan as tracks" option when you know the selection you are scanning doesn't have albums. I hope you know that ReplayGain specs state that implementations are to use the other value if the entries for your chosen mode are missing. So even if you use album as source, track gain and peaks will get used if album values are missing.
But if you prefer to always use album scanner, configure the album grouping pattern to treat streams differently. For example to only use the default group for normal files and treat everything else as individual entries, try something like:
Code: [Select]
$if($strcmp($left(%_path_raw%,7),'file://'),%album artist% | %date% | %album% | %discnumber%,%path%)

Much to my surprise after restarting foobar art for streams was not visible in properties where the tag files according to file size clearly had the art embedded.
Then I rescanned all streams one by one to fix TPS ALBUM values.
I have noticed tag detection issue with streams too. foobar2000 doesn't always take the new successful tagging of streams into effect but you were too hasty to do hard invidual scanning again. The tags should be detected if you for example start playing the stream. Or, select the tracks and command info reload.

Really good solution this external tag stuff.

Sorry for the long text.
Happy to hear!

And long text is not a problem when it makes sense, and yours did perfectly.

Re: External Tags

Reply #478
I should have known some stations actually need this. I uploaded a new hotfix at https://foobar.hyv.fi/?view=foo_external_tags that only truncates at question mark when required by length. Hopefully this allows everything to work correctly.
Attempting to install update 2 by installing over 1.5.14 crashes Foobar 1.6.18.  Trying to re-install 1.5.14 creates the message
Failed to load DLL: foo_external_tags.dll
Reason: This component is missing a required dependency, or was made for different version of foobar2000..

Re: External Tags

Reply #479
I got hit by the mutex vs runtime issue. Reuploaded a recompile.
Downgrading should have worked nicely at least by manually deleting the crashing dll and updating then, or replacing the dll in the component directory directly.

Re: External Tags

Reply #480
I got hit by the mutex vs runtime issue. Reuploaded a recompile.
Downgrading should have worked nicely at least by manually deleting the crashing dll and updating then, or replacing the dll in the component directory directly.
Thanks Case.  The portable version has made me a lazy downgrader, I just restore my last whole backup.

Re: External Tags

Reply #481
But if you prefer to always use album scanner, configure the album grouping pattern to treat streams differently. For example to only use the default group for normal files and treat everything else as individual entries, try something like:
Code: [Select]
$if($strcmp($left(%_path_raw%,7),'file://'),%album artist% | %date% | %album% | %discnumber%,%path%)
I do prefer only two options in my rightclick menu. One for scanning (everything included) and one for deleting all TPS tags.

I made the change to the grouping pattern and that works.
Almost all ALBUM fields are NULL (as expected), but I guess you missed to NULL a couple of the fields.
See the attached screenshots.
Please fix.

The last hotfix for External Tags works fine. All streams are now tagged successfully.

I can display all attached art in JS3.
Now struggling how to access the attached art in ELP Popup.
I can access the album cover just fine with $albumart, which doesn't use a path in the call.

Logo's however have to be retrieved by using $imageabs or $drawimage which need a path (typically %path%) and an artreader_disc or artreader_back option.

So I restored the correct path:
Code: [Select]
		$if($stricmp($cut(%path%,8),exttag:/),
$puts(path,%el_user_profile_path%\external-tags\$trim($replace($substr(%path%,10,999),:,_,/,_)).tag)
$if($findfile($get(path)),
$drawrect(0,  0,                $get(p.fw),  $get(p.fh),  255-0-0-128, 255-0-0-255) // DEBUG - TAG FOUND
)
,
$puts(path,%path%)
)
Screen goes nicely red because the tag is found,
But when I use the imageabs/drawimage function pointing to this correct tagfile it always draws the logo's contained in the first item of the group which point to a completely different external tag for which I did NOT resolve the path.
So the only way to get it working is to make sure that every station has it's own group.
Beats me.

Re: External Tags

Reply #482
I made the change to the grouping pattern and that works.
Almost all ALBUM fields are NULL (as expected), but I guess you missed to NULL a couple of the fields.
See the attached screenshots.
You find cool bugs. I failed to replicate this with any real world scenario, but it happens if no track matches the album grouping pattern. Each track should match its own group, so I'm a bit confused how this code path was reached.

And that brings us to why I'm posting here before releasing a new version: as album mode treats (or should treat) each track as its own album, those album fields are not supposed to be blank. They are supposed to replicate the track values with the example grouping pattern I shared. You seem to think they should be blank, will you be disappointed if I fix them to not be blank?

Now struggling how to access the attached art in ELP Popup.
[...]
But when I use the imageabs/drawimage function pointing to this correct tagfile
I don't claim to understand anything that goes on in EL Playlist, but I don't see how pointing draw function to the tag file can work. The tag file is not a format supported by foobar2000, and my component doesn't pretend to be able to do anything to it when loaded externally. So using it as a source should error out. Any core album art extraction routine should be directed at the path seen by foobar2000, so just %path%.

Re: External Tags

Reply #483
And that brings us to why I'm posting here before releasing a new version: as album mode treats (or should treat) each track as its own album, those album fields are not supposed to be blank. They are supposed to replicate the track values with the example grouping pattern I shared. You seem to think they should be blank, will you be disappointed if I fix them to not be blank?
Not at all. As long as it is consistent, so all fields filled is fine too.


About PSS/ELP in relation to embedded art (normal files or external tags):

ELP $drawimage and $imageabs always use the first item in a group or popup group when you want to display one of the embedded images (for physical files and for external tags). This is fine for the group header but quite undesired with the popup function. Even when obviously %path% is different for different items within the group it just reverts to retrieving the art from the first item.
ELP has an extra function $albumart which is not present in PSS. This function can only display Front (embedded or external), and with this function you can choose to show Front from the first item or from the current item. So display of album cover / station image for different items in a popup works fine.

There is no way to retrieve any other embedded art besides Front from an item if it is not the first one in the ELP group popup, which just means I have to use the old method and retrieve external art.

I guess a request for change won't be responded upon :-)

PSS $drawimage and $imageabs both accept %path% when it holds exttag and with artreader option you can display the embedded front, back, disc, icon or artist. If something is not filled I detect that and can revert to the old method of retrieving art based on station name. So no issue at all with embedded art in PSS.

As far as I can see the usage of external tags is completely transparent to all the things I do in JS3, PSS and ELP.
Only difference is that you cannot add art to Icon in an external tag which you can do with a normal file.

Re: External Tags

Reply #484
I uploaded a quick update to the True Peak Scanner preview that fixes the album-with-zero-tracks issue.

Re: External Tags

Reply #485
I uploaded a quick update to the True Peak Scanner preview that fixes the album-with-zero-tracks issue.
Thank you.

All tags are written except for TPS_CLIPPED_SAMPLES_ALBUM which I normally use to calculate something about overall clipping in the group header.
I checked for a normal album scan and in that case the field is written (like before).

Re: External Tags

Reply #486
Thanks, fixed version uploaded. I neglected to mention it but today's preview contained more changes than just fix for empty album issue. I changed number printing to force C-locale like in DR Meter (some third party processes can override foobar2000 locale which can turn sprintf() and friends to switch from decimal point to decimal comma) and I noticed that scanning error, such as a missing track, can cause similar issues like the album escape issue you managed to trigger. No serious harm from that, but it caused result dialog to show nonsensical values for a track that wasn't even scanned.

Re: External Tags

Reply #487
Thanks, fixed version uploaded. I neglected to mention it but today's preview contained more changes than just fix for empty album issue. I changed number printing to force C-locale like in DR Meter (some third party processes can override foobar2000 locale which can turn sprintf() and friends to switch from decimal point to decimal comma) and I noticed that scanning error, such as a missing track, can cause similar issues like the album escape issue you managed to trigger. No serious harm from that, but it caused result dialog to show nonsensical values for a track that wasn't even scanned.
This latest version writes all fields.

It is however calculating averages when you scan streams.
Even with the album grouping set to:
$if($strcmp($left(%_path_raw%,7),'file://'),%album artist% | %date% | %album% | %XXXdiscnumber%)

I also checked the streams and $left(%_path_raw%,7) is, like expected,  'exttag:' which means they should not use my grouping, but apparently TPS does.

Re: External Tags

Reply #488
Take a closer look at your grouping pattern. It only uses a group for "file://" paths. Everything else has blank group, which means everything is considered to belong to the same group. The example pattern I gave you is the opposite, it only uses sane groups for files and creates a new group for everything else.

Re: External Tags

Reply #489
Take a closer look at your grouping pattern. It only uses a group for "file://" paths. Everything else has blank group, which means everything is considered to belong to the same group. The example pattern I gave you is the opposite, it only uses sane groups for files and creates a new group for everything else.
Sorry for being stupid. I don't have a clue what you consider to be groups/albums internally in TPS. Kind of strange that streams can be grouped together anyway. I really don't want to have more entries appearing in the context menu with long texts which will require reading before clicking.

I changed the grouping pattern to:
$if($strcmp($cut(%_path_raw%,7),'file://'),%album artist% | %date% | %album% | %XXXdiscnumber%,%path%)

This seems to work. Rescanned all streams. No new surprises after the last preview for TPS and last hotfix for external tags.

Changes all my code to fully benefit from the (manually) added %station%. And changed all relevant code to prioritize embedded Front as Station Images.
Only thing to be fixed is adding Icon to external tags, but I guess that is for Peter. Same for making a global tag available always with station name when streaming,

Thx.

 

Re: External Tags

Reply #490
That's why the grouping pattern is configurable everywhere. Default playlist calls it 'grouping scheme', Columns UI uses simply term 'group', built-in ReplayGain scanner also calls it 'grouping pattern'. It's a titleformat string that defines which tracks are considered to belong to the same group. All tracks that produce the same output from the formatted pattern will belong to the same group. Easy to test for example by adding the grouping pattern as a playlist column.

Edit: The Icon tag not working in APE tags is already fixed in internal alpha, so that at least will be a solved problem soon.