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: Playlist-Tools-SMP (Read 60304 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Playlist-Tools-SMP

Reply #25
Was a one line problem.

Line 56 -> (filter empty queries)
Code: [Select]
const query = query_join(queryArr.filter(Boolean), "OR");

Feel free to totally delete the AUDIOMD5 tag if you don't use it. It's not required at all.

And this will be the readme, hope it's clearer now.
Quote
Alternative to foo_playlist_revive.
Playlist Revive makes dead items in a playlist alive again by replacing them with the matching ones in media library.
A handy utility for those who often move or rename their media files/folders.

Querying:
   - TITLE
   - AUDIOMD5 (tag from foo_md5 if found) (*)
   - MD5 (tag from foo_md5 if found) (*)

Matching (rules by order):
   - Audio MD5 (file info) (Exact Match) (*)
   - AUDIOMD5 (tag from foo_md5 if found) (Exact Match) (*)
   - MD5 (tag from foo_md5 if found) (Exact Match) (*) (**)
   - TITLE + Length + Size (Exact Match)
   - Tags (Similarity)

Usage:
   - Select the tracks in the relevant playlist.
   - Apply script (using a button, menu entry, main menu SMP, etc. associated to it).
   - The tools allow to only replace with exact matches or by some similarity threshold.
   - 'Simulate' options just simulates the processing, does nothing but reporting you -planned- changes.
   - The console always reports the tracks changed and info, contrary to what foo_playlist_revive plugin did.

(*) Audio MD5 is a feature of some formats which store audio checksums as part of their file info.
That's different, although similar, to a tag named AUDIOMD5 (or MD5) by foo_md5 plugin.
On the first step -querying-, the tag is used if available (it's not a requisite).
On the second step -matching-, the file info is used if available (for some formats), if it's not found
then it tries the tag counterpart. If it's not found it tries the next rule, ...
(**) foo_md5 plugin lets you configure the tag name. I use those 2 as possible names to look for.
Plugin can be found here: https://foobar.hyv.fi/?view=foo_audiomd5
Note that for formats having CRC checks (like flac), you can also get an md5 tag with mass tagger scripts:
$info(md5) -> copy -> AUDIOMD5
You can find such preset at '.\presets\Masstagger'


Re: Playlist-Tools-SMP

Reply #26
 Yes, now it makes sense, thanks for explaining. I downloaded the file and I tested again, this time it works ( even without  AUDIOMD5, as you said) but another problem appears : the other songs in the playlist disappear,  only the fixed song remains.

Re: Playlist-Tools-SMP

Reply #27
Songs not "dead" are removed or the dead songs not revived are removed from the list?

Can't reproduce any of those cases. Have tried with a playlist with:

- Tracks on library.
- Dead items but with alternative on library.
- Dead items with no match.

After reviving playlist, with selection or entire playlist, all items are the same on the playlist. Dead ones are substituted, but that's all. The one without match is left, the same than the other tracks

Re: Playlist-Tools-SMP

Reply #28
A problem about playlist revive.....When I move a file from a partition to another partition , let's say D\music to E\music (obviously the folders are included in the media library) or when I rename a folder this is what happens

Playlist Tools - Other Tools - Playlist Revive - Replace dead items on selection (or if I use Replace dead items on current playlist), I have this kind of errors :

Query not valid. Check query:
(title IS I Will Always Love You) OR (undefined)

I don't know why but I can't revive dead items in a playlist....

Problem number 2.
Most played tracks from.....from last -- 1 week (for example)
It seems that songs that have a high playcount are favoured, so they get at the top of the playlist
I'll give you this example: Let's say that in the last week I have listened Bon Jovi - Always , ONLY once, BUT the total playcount for this song is 30.
This week I also listened Madonna - Frozen , 10 times BUT the total playcount for this song is 12.
The conclusion:  Most played tracks from last week will look like this :
Bon Jovi - Always (playcount in a week :1 , total playcount : 30)
Madonna - Frozen (playcount in a week :10 , total playcount : 12)
I think it should be exactly the opposite, like this :
Madonna - Frozen (playcount in a week :10 , total playcount : 12)
Bon Jovi - Always  (playcount in a week :1 , total playcount : 30)

I tested on a few songs and it's the same. This way Most played tracks from.....from last -- 1 week (or other period) it's a bit useless because I'll see songs with high playcount at the top (obviosly if I played those songs with high playcount in the selected period), it doesn't reflect the reality. Maybe you can fix it
As I said in the other post , I used the last version of the scripts, portable Foobar 1.6.6 , clean install, only SMP ( vers. 1.4.1) installed

Revising the code of top tracks from... everything seems to be right. They are indeed sorted by playcount, but the count is taken from the period.

Could you send me 2/3 tracks with those tags (with play timestamps) to check? I'm currently on a system without enhanced statistics, so can not check that part!

Re: Playlist-Tools-SMP

Reply #29
This is what I do : I make a playlist with songs from library
Then I move a song in a new folder that I create (the created folder is in library, on the same drive) , or I just simply move a song from one drive (let's say D\Music) to another drive (E\Music), both on library

Songs not "dead" are removed . The only song that remains in the playlist is the revived item( song) . So, the ''dead" song is successful
revived, BUT the other not dead songs are removed . All songs are in library,


"- Dead items with no match.""

If I try this all songs remain in the playlist , but obviously it's useless
I've sent you a message with a gif


Yes, I'll send you 2 tracks in 20-30 minutes

Re: Playlist-Tools-SMP

Reply #30
The playlist revive is done now. Thanks for the gif... you see selecting the culprit or all changed totally the behavior, would have not found the problem without it.

Check latest file :)

PD: has also fixed another related bug
Quote
- Other tools\Playlist Revive: undefined queries when file didn't had AUDIOMD5 tag (from foo_md5) are now skipped. The plugin was never a requirement, but an extra to find faster matches by query. If you use the plugin, their tags will also be used; otherwise, the tool queries by title and compares md5 file info first (if avalaible) or file size (for exact match) and then all tags to compute similarity.

- Other tools\Playlist Revive: reviving selection (instead of entire playlist) no longer outputs only the selected items, but recreates the entire playlists; dead items with matches are replaced and dead items without a match or other items are left untouched. Current item selection will also remain selected after processing.

- Other tools\Playlist Revive: bug on reviving All playlists which made only active playlist to be actually changed (the rest was analyzed but not touched).

Re: Playlist-Tools-SMP

Reply #31
This week I also listened Madonna - Frozen , 10 times BUT the total playcount for this song is 12.
The conclusion:  Most played tracks from last week will look like this :
Bon Jovi - Always (playcount in a week :1 , total playcount : 30)
Madonna - Frozen (playcount in a week :10 , total playcount : 12)
I think it should be exactly the opposite, like this :
Madonna - Frozen (playcount in a week :10 , total playcount : 12)
Bon Jovi - Always  (playcount in a week :1 , total playcount : 30)

I tested on a few songs and it's the same. This way Most played tracks from.....from last -- 1 week (or other period) it's a bit useless because I'll see songs with high playcount at the top (obviosly if I played those songs with high playcount in the selected period), it doesn't reflect the reality. Maybe you can fix it
As I said in the other post , I used the last version of the scripts, portable Foobar 1.6.6 , clean install, only SMP ( vers. 1.4.1) installed

Solved. Was a really stupid typo I made at some point while refactoring the code at a later release... I was substracting current date to played dates, instead of doing the opposite. So it was in fact reporting tracks less played -but at least played once- in the given period hahahaha (*). Resulting in playcounts -within the given period- from low (top) to high (bottom). Having an absolute playcount track at top was just a coincidence on your library.

Btw the files did not prove useful at all because the statistics are saved within foobar config and not the files. But anyay it's solved now.

Replace at .\main\top_tracks_from_date.js

(*) Not sure if such function has any utility btw. Usually we want to find the most played tracks... but maybe it has some use to revisit tracks played less on a given period (?)

Re: Playlist-Tools-SMP

Reply #32
Yay, great that it's solved :) Well, I remember that I saw Moya Brennan - Show Me , at the top of the list, I accidentally listened this song only once and I knew it was the song with the most playcounts in the library (but lately I didn't listened at all) so I said "hmm something is wrong here" :) So I tested again with other 2 songs with high playcount , I listened them only once .
So now it makes sense why they were at the top of the list :) Good that it's solved, I tested again and everything seems ok

Re: Playlist-Tools-SMP

Reply #33
Have updated the repository with all the latest changes and all bugfixes.  There are major changes, HTTP control integration, some new tools, readme for all tools, auto-show readmes when adding buttons, etc. If anyone want to test it, download the files directly from the repository not the releases.

(it's recommended to also download the latest files from the rest of my scripts, since I have changed all with major changes)

Changelog is up to date on github. Check unreleased.

Re: Playlist-Tools-SMP

Reply #34
Since someone asked for it, to change key tag on Playlist tools (for harmonic mixing) change this variable at: xxx-scripts\main\playlist_tools_menu.js (line 21)
X

(it will be configurable on next release)



Re: Playlist-Tools-SMP

Reply #35
Have updated the repository with the new menus to remap tags, an important change to harmonic mixing and pools which should greatly speed up (x1000) their use with large handle lists and new presets (masstagger).

If anyone want to test it, download the files directly from the repository not the releases. Please have in mind the relative path bug on SMP has not been solved yet, so I have no idea if it will work for you!
(it's recommended to also download the latest files from the rest of my scripts in that case, since I have changed all with major changes)


EDIT: Export your Playlist Tools preset list (at config menu) to have a backup if you added your own entries to the menus! The last update will break previous properties (and thus presets). Save them and re-import them after installing.

Re: Playlist-Tools-SMP

Reply #36
Maybe I misunderstand something but when I use:  Playlist tools - other tools - import track list - import from file \ url  , I get no result, using the example track_list_to_import.txt .

As you see in the pic, I put a song in the library Aretha Franklin - Respect, but it doesn't find anything.

Also, when I export a playlist from Spotify in txt. format I have this, for example :
Aretha Franklin - Respect

I tried to modify this [". ","%title%"," - ","%artist%"] from your example, but it didn't worked.

Re: Playlist-Tools-SMP

Reply #37
Error on my side. Missed some quotes somewhere on a last minute change so no query worked. Fixed, replace file at 'main\'. Now should work in all cases. Updated also github.

And it seems I also forgot to add it to the 'test tools' macro, which would have found the problem too automatically (both macros run all tools from menu for easy testing). Fixed it too (at github and requires restoring defaults on macro menu).
Thanks!

Re: Playlist-Tools-SMP

Reply #38
Yep, your example (that text file, track_list_to_import) is working now.
But now I think it's a error on my side :)
I made another txt file (a playlist exported from Sotify in txt format), track_list_to_import. It looks like this :

Cock Robin - Stumble and Fall
Joe Hisaishi - A Road to Somewhere
The Police - Every Breath You Take

You have this (for your txt file) : [". ","%title%"," - ","%artist%"]

What should I use for my case? I probably tried everything , except the good version :)

Btw, this is a nice little feature, now it's easier to import a playlist from Spotify to Foobar and vice versa. Also it will be cool if we can save more presets, not only your example

Re: Playlist-Tools-SMP

Reply #39
Yep, your example (that text file, track_list_to_import) is working now.
But now I think it's a error on my side :)
I made another txt file (a playlist exported from Sotify in txt format), track_list_to_import. It looks like this :

Cock Robin - Stumble and Fall
Joe Hisaishi - A Road to Somewhere
The Police - Every Breath You Take

You have this (for your txt file) : [". ","%title%"," - ","%artist%"]

What should I use for my case? I probably tried everything , except the good version :)

Btw, this is a nice little feature, now it's easier to import a playlist from Spotify to Foobar and vice versa. Also it will be cool if we can save more presets, not only your example
In fact I created it for online playlists found at random places: 'Top 100 guitar tracks', etc. It was a pain having to look for all the tracks  matching them manually in my own library! But yep, it may be used to sync spotify playlists and probably other use-cases.
This is an easy way to share playlists between users too, since they are path agnostic and may be loaded in anyone's library matching just what they got.

Uhm... I could make it remember the last "preset" used.  But not sure about adding a list or presets, it's unnecessarily complex.
I mean, if you download random lists from internet, you will need to edit it no matter what. And if you use it for an specific source (Spotify) then using the last one should be good enough, since it will always be the same.

Code: [Select]
["%artist%"," - ","%title%"]

You probably used the right one But it's a(nother) bug on my side. I didn't contemplate the first value being a tag (expected a number, etc.), so it always failed. Use the above code with the new file. Now it should work as expected in any case, no matter the tag positions.

Re: Playlist-Tools-SMP

Reply #40
Yeah, I used that too , good that it's solved :)
"Uhm... I could make it remember the last "preset" used.  But not sure about adding a list or presets, it's unnecessarily complex."

You're right . I only asked for presets because I didn't managed to get the results that I wanted (but now we know it was because of the bug) and I was thinking : "hmmm , maybe we need presets here, so next time I will have faster results with the playlist? " haha :)
No need for presets


Re: Playlist-Tools-SMP

Reply #41
Now it stores the last value used at Import track list\Import from file \ url...
The other entry uses the same (last) format mask value. No further changes.

Will update it on github later today.

Re: Playlist-Tools-SMP

Reply #42
Have updated the repository with all the previous fixes. The latest SMP dev build fixes the relative paths bug too, so it should be safe to update to the new version from now on.
https://ci.appveyor.com/api/projects/theqwertiest/foo-spider-monkey-panel/artifacts/_result%2FWin32_Release%2Ffoo_spider_monkey_panel.fb2k-component?branch=master&job=Configuration%3A%20Release

Re: Playlist-Tools-SMP

Reply #43
I have a suggestion if you like it and it's easy to implement. When using: Playlist tools - other tools - import track list - import from file \ url ...... It's possible after we import that text file with songs to have the results about tracks not found on libary, like this :

the buggles - video killed the radio star
peter gabriel - sledgehammer
culture club - karma chameleon
billy ocean - when the going gets tough, the tough get going
guns n' roses - sweet child o' mine

Currently we have this :

Line 0-> Artist: the buggles, Title: video killed the radio star
Line 2-> Artist: peter gabriel, Title: sledgehammer
Line 6-> Artist: culture club, Title: karma chameleon
Line 7-> Artist: billy ocean, Title: when the going gets tough, the tough get going
Line 10-> Artist: guns n' roses, Title: sweet child o' mine
This is useful for big playlists (I had a playlist with 1300 songs from spotify, and this behavior would be great ) , because the returned songs that are not found on the library can easily be imported for example in a playlist on youtube ( using this https://www.tunemymusic.com/File-to-Spotify.php#step5) , and then played inside foobar  (or you can do something else with that playlist)
I'm not saying the old behavior must be removed, just if it's possible to add this too, the possibility to return only Artist - Title (for the songs not present in library).

Re: Playlist-Tools-SMP

Reply #44
I have a suggestion if you like it and it's easy to implement. When using: Playlist tools - other tools - import track list - import from file \ url ...... It's possible after we import that text file with songs to have the results about tracks not found on libary, like this :

the buggles - video killed the radio star
peter gabriel - sledgehammer
culture club - karma chameleon
billy ocean - when the going gets tough, the tough get going
guns n' roses - sweet child o' mine

Currently we have this :

Line 0-> Artist: the buggles, Title: video killed the radio star
Line 2-> Artist: peter gabriel, Title: sledgehammer
Line 6-> Artist: culture club, Title: karma chameleon
Line 7-> Artist: billy ocean, Title: when the going gets tough, the tough get going
Line 10-> Artist: guns n' roses, Title: sweet child o' mine
This is useful for big playlists (I had a playlist with 1300 songs from spotify, and this behavior would be great ) , because the returned songs that are not found on the library can easily be imported for example in a playlist on youtube ( using this https://www.tunemymusic.com/File-to-Spotify.php#step5) , and then played inside foobar  (or you can do something else with that playlist)
I'm not saying the old behavior must be removed, just if it's possible to add this too, the possibility to return only Artist - Title (for the songs not present in library).
Note you can easily get what you want with any text editor:
Replace -> ", Title: " with ""
Select and remove "Line X-> Artist: "

For the 2nd step you need a text editor which allows vertical selections, with alt. Notepad works, Word too. It takes 10 seconds on my side to do that.

Replicating the same list on the same popup does not seem a good idea, so I may offer a config to either show Lines (default) or what you suggest.

Note there is a reason why I didn't return a list like you suggest: that list is created with the results the script got from reading the file after applying the masj, i.e. they may be wrong. That's why Lines are shown. Offering an alternate playlist implies the assumption of those lines being right, so that can not be the default behavior.

I will edit the reports of tag checking too for the same reason. I added all text to one popup and It should be in multiple popups.

Re: Playlist-Tools-SMP

Reply #45
Just updated the repository.  It includes all previous fixes. The invert selection is a pretty simple utility but noticed it was missing on Foobar! Has become really useful along playlist search or macros.

### Added
- Select...\Invert selection: inverts current selection on active playlist.

- Presets: scripts for Picard to retrieve high level tags (gender, valence, danceability, speechiness, ...) from AcousticBrainz high level data. Tags are easily configurable. AcousticBrainz Tags plugin 2.2+ is required (within Picard). Those tags are meant as a direct replacement, using an open source data model, of Spotify's tags... which can only be retrieved with an API in some software and rely on closed source models and data (new data can not be added by users). If some tracks are not in AcousticBrainz database, they may be analyzed locally to then send send the results to their server and later get the results on Picard.
See discussion here: https://hydrogenaud.io/index.php?topic=120982.msg1001549#msg1001549

- Other tools\Import track list: Reads a txt file containing a track list and finds matches, if possible, on library. The results are output to a new playlist ('Import'). The input path may be a file path or an url pointing to a txt file. Specially useful to easily create playlists (with matches from your library) from online playlists, charts, etc. (like '100 greatest rock songs', ...). Skipping the need to manually add one by one the tracks to your own version of the playlist. Not found tracks are reported with a popup. Format mask is saved between calls.

### Changed
- Check tags: Split popup report on 3 different popups according to their content (queries, errors and exclusions).
- Import tool now shows 2 popups.

Re: Playlist-Tools-SMP

Reply #46
Yup, finally we have Invert selection! Probably should be already included in foobar. Actually I wanted to ask you about this for a few days, haha. I was using a old component foo_menu_addons  (1.4.2) but it's from 2010 (I barely founded it, almost 2 years ago, because all links were dead) . Now I can uninstall it :)
And thanks also for the improvements for Import track list

Re: Playlist-Tools-SMP

Reply #47
Have also added the expand function (which is essentially the same than Playlist filtering but setting selection), move selection (on current playlist) and jump to next/previous tracks by tags. So it should fully replace the plugin now if we talk about selection manipulation (btw the jump part of the plugin crashed foobar on my side, so the plugin is not safe to use nowadays).
Will also consider creating buttons which can be assigned to the submenus... (for example to have a Selection manipulation button which opens the selection menu directly).

Spoiler (click to show/hide)

PD: using these entries along macros could be used to create really interesting playlist creation macros (since you may traverse the playlist using arbitrary tags to select things).

Re: Playlist-Tools-SMP

Reply #48
Was a bit harder than expected but works. The entire submenu tree from Playlist Tools may be recreated into an individual button, making it faster to work with some tools (like foobar main menus) (*). SMP 1.5.2 has been added as requisite on installation notes (since I noticed some people was using older versions... which may break things).

Also fixed a bug on Search by Distance (I accidentally deleted some lines so it always crashed with the latest files), and some minor fixes when adding/removing buttons (properties not being automatically deleted).

All is now updated in the repository. As soon as the relative path bug gets definitely fixed on SMP I will create a proper release...

Spoiler (click to show/hide)

(*) If someone was interested into integrating Playlist Tools within a custom theme, now it should be relatively easy to split all submenus and create a menu bar with the desired theme (ditching the used grey button theme).

Re: Playlist-Tools-SMP

Reply #49
Looking for some guidance

I have a portable installation of foobar 1.6.6

Steps I followed

1. Create scripts\SMP\xxx-scripts folder structure in profile folder :
C:\Users\<MY_USERNAME>\.user\audio.players\foobar2000\profile\scripts\SMP\xxx-scripts

2. Drag Playlist-Tools-SMP-2.0.0 folder from archive folder into xxx-scripts :
C:\Users\<MY_USERNAME>\.user\audio.players\foobar2000\profile\scripts\SMP\xxx-scripts\Playlist-Tools-SMP-2.0.0

3. Enable Layout Editing Mode and create new UI element : Spider Monkey Panel v 1.5.1

4. Click panel created in step 3

5. Click File -> Import -> and locate buttons_toolbar.js

6. Click OK

7. Error window pops up (screenshot posted below)

any ideas? looking forward to using this, thanks!