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: Find & Play (Read 18658 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Find & Play

Reply #50
That solved both things, thanks!
Had to use 1) for the playlist creation using find tracks in library + last. fm data.

BUT there is a problem with fuzzy matching, you implemented it only for playlist creation.  'Tag playlist items with Last.fm track statistics...' will skip those tracks since the fuzzy matching logic was not added there when checking the playlist items.

Have no idea if there are other points where you have missed it too, only found that use-case.

Re: Find & Play

Reply #51
Not applying fuzzy logic when matching last.fm names to library track names during writing the popularity tag was a deliberate decision. Track names sometimes have very subtle differences and so fuzzy matching can lack specificity. Same applies to library track matching during playlist generation by auto DJ or find etc. but then it's not as critical as it's not altering the music files.

Anyway in the next version the standard matching will ignore diacritics, e.g. a = á, so your use case would be solved more specifically that way.

If you want to try it before then, you can change the strip function in helpers. You should be able to switch partial matching off.

Code: [Select]
	strip(n) {
n = n.replace(/[.\u2026,!?:;'\u2019"\-_\u2010\s+]/g, '').toLowerCase();
return this.removeDiacritics(n);
}

It's trivial to add the fuzzy logic to the tagger if you still think its warranted.

Re: Find & Play

Reply #52
Not applying fuzzy logic when matching last.fm names to library track names during writing the popularity tag was a deliberate decision. Track names sometimes have very subtle differences and so fuzzy matching can lack specificity. Same applies to library track matching during playlist generation by auto DJ or find etc. but then it's not as critical as it's not altering the music files.

Anyway in the next version the standard matching will ignore diacritics, e.g. a = á, so your use case would be solved more specifically that way.

If you want to try it before then, you can change the strip function in helpers. You should be able to switch partial matching off.

Code: [Select]
	strip(n) {
n = n.replace(/[.\u2026,!?:;'\u2019"\-_\u2010\s+]/g, '').toLowerCase();
return this.removeDiacritics(n);
}

It's trivial to add the fuzzy logic to the tagger if you still think its warranted.
Ok! Yep, I know how to do it myself, I thought it was an error. Thanks!
You may be right although that leaves some cases without possible tagging (since the calcs are done internally).

Apart from the improvement you comment, instead of automatically tagging those [not matched] tracks (contrary to your design), maybe you could consider a different approach: adding a new icon at the right (next to pos  and playcount) which would output a popup with the calculated popularity. Or maybe you find a better UI approach, but you get the idea.

That way lets say we have 20 tracks which are not properly matched but we are sure we want to use an specific popularity value from tracks on the panel list, we can just click and copy/paste the value to tags one by one. The current UI allows multiple selection, so maybe it can be processed on entire lists too. Should not require a lot of work, takes into consideration your concerns and gives the user possibility to do its own tagging.

Re: Find & Play

Reply #53
Quote
The current UI allows multiple selection, so maybe it can be processed on entire lists too

Well that can be done already. Select the items in the last.fm top tracks list to be tagged using middle click. They'll be added to the playlist. Then select the items in the playlist & tag.

It's also possible to use the + (top right), then click local. That will load all the matching library tracks into a playlist which can be tagged. Best if track source on drop down is set to library, so cached youtube tracks don't load,  as I think foo_youtube has issues with adding multi-value tags.

So no need to copy/paste and tag one by one.

Re: Find & Play

Reply #54
Quote
The current UI allows multiple selection, so maybe it can be processed on entire lists too

Well that can be done already. Select the items in the last.fm top tracks list to be tagged using middle click. They'll be added to the playlist. Then select the items in the playlist & tag.

It's also possible to use the + (top right), then click local. That will load all the matching library tracks into a playlist which can be tagged. Best if track source on drop down is set to library, so cached youtube tracks don't load,  as I think foo_youtube has issues with adding multi-value tags.

So no need to copy/paste and tag one by one.
Another error doing exactly that:
Quote
[20:39:57] foo_spider_monkey_panel:
Error: Spider Monkey Panel v1.6.1 (Find & Play v1.1.1 by WilB)
Index is out of bounds

File: web.js
Line: 1985, Column: 7
Stack trace:
  runAddLoc/</<@web.js:1985:7

Re: Find & Play

Reply #55
Quote
The current UI allows multiple selection, so maybe it can be processed on entire lists too

Well that can be done already. Select the items in the last.fm top tracks list to be tagged using middle click. They'll be added to the playlist. Then select the items in the playlist & tag.

It's also possible to use the + (top right), then click local. That will load all the matching library tracks into a playlist which can be tagged. Best if track source on drop down is set to library, so cached youtube tracks don't load,  as I think foo_youtube has issues with adding multi-value tags.

So no need to copy/paste and tag one by one.
Uhm... not sure what was going on, but the tracks needed to be reloaded to see the tags. In fact it seems using the 'Find tracks in library' + artist and then tagging also worked fine with the fuzzy matching. Not sure if that's different in any way to manually selecting the tracks or the + and local method. But in all those cases track properties needed to be reloaded (which did not happen in my previous uses, so I never thought about it).

Re: Find & Play

Reply #56
That's the error you reported before? It's should be fixed in the shortly to be released version.

If you don't want to wait replace the function in web.js ~ line 1954 (I think the only changes were in that):

Code: [Select]
	runAddLoc(p_loc, p_alb_id, p_pn, p_alb_set, type) {
if (type == 'outstanding') $.sort(p_loc, 'id');
if (p_alb_set) { // should only be one item so can clear here
if (p_alb_set !== 2) pl.clear(pl.selection());
}
p_loc.forEach(v => {
if (type == 'stnd') {
if (v.id == (!p_alb_set ? panel.add_loc.ix : p_alb_id)) {
v.id = 'x';
panel.add_loc.ix++;
} else return;
}
if (type == 'outstanding') {
if (v.id != 'x') v.id = 'x';
else return;
}
if (v.path) {
this.start[v.path.slice(-11)] = Date.now();
panel.addLoc(v.path, p_pn, true, p_alb_set, p_alb_set, true);
if (p_alb_set) panel.addLoc(v.path, pl.selection(), true, p_alb_set, p_alb_set);
if (p_alb_id == 'playTracks') panel.addLoc(v.path, pl.cache(), true, p_alb_set, p_alb_set, true);
} else if (v.handle) {
let timeout = this.loadTime.length ? Math.min($.average(this.loadTime), 500) : 25;
this.hl.Add(v.handle);
setTimeout(() => {
const pn = pl.selection()
if (p_alb_set) plman.ClearPlaylistSelection(pn);
panel.add_loc.timestamp = Date.now();
if (!p_alb_set || p_alb_set === 2) plman.UndoBackup(pn);
if (p_alb_set) plman.InsertPlaylistItems(pn, plman.PlaylistItemCount(pn), this.hl, p_alb_set);
else plman.InsertPlaylistItems(p_pn, plman.PlaylistItemCount(p_pn), this.hl, p_alb_set);
if (p_alb_set) {
plman.EnsurePlaylistItemVisible(pn, plman.PlaylistItemCount(pn) - 1);
plman.SetPlaylistFocusItemByHandle(pn, this.hl[0]);
}
this.hl = new FbMetadbHandleList();
}, timeout);
}
});
}

Tags not showing. Where? Properties or playlist? I assume you selected all the tracks in the playlist before tagging. I just tested with DUI playlist & all worked. Plus tags were in properties as well. If the tags are in properties then I would have thought Find & Play has done its job and may be it's a local refresh issue? All the script can do is send the tags to the SMP tagger. It seems that happened as the tags either appeared immediately or on reload.

Re: Find & Play

Reply #57
Quote
That's the error you reported before? It's should be fixed in the shortly to be released version.
It probably is. Sometimes happens when click in a track within the panel, usually while it's loading something.

Tags not showing on properties. I.e. I send one track to a playlist and tag all tracks on playlist (one), then I open the properties and the tag is not showing. Clicking reload shows it.

It clearly is a local reload issue by SMP, which is funny because the script clearly updates the tags... so the db should be updated too since it's done withing the program context XD
But it seems SMP writes the tags to files without warning Foobar to update the db, not sure if that's intended by design, an error or there is just some delay.

Re: Find & Play

Reply #58
New Version: Find & Play v1.2.0

The readme has been rewritten with new screenshots to more fully reflect capabilities.

Main changes

Added
- Library playlist generator
    - Easily create awesome playlists by songs, artists, genres, moods, themes, decades, locale or queries
- Auto DJ & library playlist generator
   - search suggestions
   - inbuilt support for 1,000+ genres, 350 moods & 250 themes + choose your own
   - smart mix feature for library playlist generator
   - browse & search dialog that offers full search options with autocomplete + 'try another' if no matches
      - this is an html dialog that is supported on standard Windows installations. If you're using WINE or something else that isn't fully compliant with Spider Monkey panel features, browse & search dialog may not be available. Instead the flyout menus have an alternative 'More...' option for searching

Changed
- Standard matching now ignores diacritics, e.g. a = á
- Tagger now respects partial match setting

Fixed
A few reported issues

See the changelog for full info



Re: Find & Play

Reply #61
It looks like the ones that aren't matching are EPs. As there appears to be no agreed specific tag field for EPs, it just checks the album field.

Default uses the following type of query:
Code: [Select]
album IS MusicBrainzName
If partial match (search tab) is enabled the following type of query is used:
Code: [Select]
album HAS MusicBrainzName
Latter might be better if, e.g. 'Ballad of the Starchild' is actually named 'Ballad of the Starchild EP'?

If there are still unexpected issues, please advise foobar2000 version and post a screenshot of the properties of an item that fails so I can see all the metadata names and values.

For artist photos, go to nowplaying panel & click it until artist photos show, then toggle back. If artist photos don't show, check the path on the image tab.

Re: Find & Play

Reply #62
thanks for your help as always - the artist image tip was perfect!

It looks like the ones that aren't matching are EPs. As there appears to be no agreed specific tag field for EPs, it just checks the album field.

it does seem that most non-matching items are EP/singles

However, I am using album fields as the name and then a custom tag for the formats.
I did try with "partial matches" selected and deselected with same results (items are not matched to existing library).


Re: Find & Play

Reply #63
MusicBrainz singles are awkward to match without knowing a particular user's tagging system, which could be done in many different ways.
Currently the query is: album IS MusicBrainzSingleName [Single] (note the suffix).
A simple title match (which would include album tracks) isn't sufficient as most singles have more than one track, which show on expanding the item.

So, for the track list of a single it's better to set the source to prefer library or YouTube. Then at least you can grab all the tracks from YouTube.

To show singles that match a track in the library, regardless, line 887 can be changed:
Code: [Select]
case v.releaseType == 'Single':// && ppt.mb != 1:

EPs are kind of handled similarly to singles, but I will probably change that behavior in the next version.

If you don't want to wait until then:
For EPs change line 914 from:
Code: [Select]
if (v.releaseType != 'Album' && v.releaseType != 'Compilation' && !v.title.endsWith(' [' + v.releaseType + ']')) {
to
Code: [Select]
if (v.releaseType != 'Album' && v.releaseType != 'Compilation' && v.releaseType != 'EP' && !v.title.endsWith(' [' + v.releaseType + ']')) {

Re: Find & Play

Reply #64
If you don't want to wait until then:

aha, I didn't realize it was specifically comparing MB release types. Thanks for the effort!

Your code change suggestions worked.
The only note is titles are somewhat case specific: eg. "All" worked for one album, while 'all' did not, but both The/the filtered fine.

Re: Find & Play

Reply #65
Quote
Your code change suggestions worked

Ah good. All the matching should be case insensitive. foobar2000 queries should be case insensitive. String comparisons should also be case insensitive. I couldn't see any problems, so I'll need an exact reproducible example of the 'all' issue if you want me to look into it.

Thanks for the feedback.

Re: Find & Play

Reply #66
I couldn't see any problems, so I'll need an exact reproducible example of the 'all' issue if you want me to look into it.

Not necessarily asking, more FYI: here is "all" and I also found a "the" example.

Also of note, both examples contain releases missing from MB but which exist in discogs

btw FB 1.6.12

Re: Find & Play

Reply #67
It looks like the ones that aren't matching are EPs. As there appears to be no agreed specific tag field for EPs, it just checks the album field.

Default uses the following type of query:
Code: [Select]
album IS MusicBrainzName
If partial match (search tab) is enabled the following type of query is used:
Code: [Select]
album HAS MusicBrainzName
Latter might be better if, e.g. 'Ballad of the Starchild' is actually named 'Ballad of the Starchild EP'?

If there are still unexpected issues, please advise foobar2000 version and post a screenshot of the properties of an item that fails so I can see all the metadata names and values.

For artist photos, go to nowplaying panel & click it until artist photos show, then toggle back. If artist photos don't show, check the path on the image tab.
Search is not case insensitive in all use-cases, there is an asymmetric search advanced preference.

In particular if the variable 'MusicBrainzName' has Upper cases, then upper cases must be matched.
i.e. ARTIST IS ACDC (matches only ACDC) is not the same than ARTIST IS acdc (matches ACDC, AcDC, acdc, ....). And since Musicbrainz variable have mixed letter cases, it doesn't work properly.

Only when all lower cases are used, then search is case insensitive.
https://hydrogenaud.io/index.php/topic,116522.msg961832.html#msg961832

Lower case should be used to cover all possible use-cases and configs. MusicBrainzName should be muted .toLowerCase().

And the wiki is wrong btw, since 1.4.1.

Re: Find & Play

Reply #68
@mjm716
Thanks for the examples. I had no difficulty in reproducing the issue.

@regor
Thanks for the insight. I had actually worked out what was going at about the time you posted. But it was great to have the confirmation and extra references - thanks!

I've made the necessary changes for the next version.


Re: Find & Play

Reply #69

I've made the necessary changes for the next version.

It seems my mouse middle button doesn't dismiss the initial screen. Is that option also in the Panel Properties?

Re: Find & Play

Reply #70
options > display > style heading > start up logos
OR
panel properties: Logo Show

Re: Find & Play

Reply #71
Hi WilB,

Would it be possible to get a custom save location for when creating m-TAGs albums? i.e. -

Code: [Select]
M:\Music\_Remote\%artist%\%album%\

Also I'm curious what benefit the 3dydfy:// prefix provides? - Reading the foo_youtube topic, an old version / comment has crossed out "However it still uses own 3dydfy:// protocol to speed up playback start" from 2014 days. I already use m-TAGs to save music videos and they get automatically saved with fy+https:// so not really sure about the difference? Just curious on your experience here, I'll keep reading...

Thanks for this script, enjoying it a lot. 8)

 

Re: Find & Play

Reply #72
Foobar2000 freeze (I cant click anywhere) until Find & Play (and Biography) searching information. With the old  YouTube Track Manager was les than 1 second.

Re: Find & Play

Reply #73
@anamorphic

I've added the custom save location for creating m-TAGs albums (panel properties: M-TAGS Save Folder...) for the next version.

Regarding, fy+https: you would need to ask 3dydy again. I checked a while ago, and the implication was to carry on using 3dydfy:. In a quick check just now they both seemed to do the same thing.

@ifrankyman

It sounds like that might be an issue with the earlier foobar2000 v2 betas. Find & Play does more library analysis than YouTube Track Manager, the very things that were running slowly in Spider Monkey Panel in the v2 early betas. It was fixed in v2 beta 18, and so hopefully the issue is resolved now. All is fast for me.

Re: Find & Play

Reply #74
New Version: Find & Play v1.3.0

Now a mature media manager and browser for foobar2000 that integrates your music library with web resources

Release highlights

Album & tracks pane

-Added new last.fm features
   - Recommendations
   - Last.fm mixes
   - Sounds like, similar artists, genres (includes styles & subgenres), moods, themes, decades, year, locales
   - Top tracks: last 7 days, last 30 days, last 90 days, last 180 days, last 365 day, all time
   - Charts: real time & loved
   - Panel preview before sending to playlist: play all or selected tracks

   - Play from media library or YouTube
   - Play at click of button

   - Refresh button to load new recommendations, last.fm mixes or sync charts in real time

Added album art background option

Auto DJ

Added last.fm radio as an alternative to inbuilt

See changelog for more info

Current feature set and screenshot