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: How to hide skipped tracks from a dynamic playlist? (Read 1981 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How to hide skipped tracks from a dynamic playlist?

So basically I would like to have an autoplaylist that match certain paths but only displays music tracks that haven't been played nor skipped before.

Re: How to hide skipped tracks from a dynamic playlist?

Reply #1
Code: [Select]
"$strstr(%_path%,'A:\YOUR PATH\')" GREATER 0 AND NOT %last_played% PRESENT

Code: [Select]
("$strstr(%_path%,'A:\YOUR PATHA\')" GREATER 0 OR "$strstr(%_path%,'B:\YOUR PATHB\')" GREATER 0) AND NOT %last_played% PRESENT
...

The skip thing can not be done

Re: How to hide skipped tracks from a dynamic playlist?

Reply #2
Code: [Select]
"$strstr(%_path%,'A:\YOUR PATH\')" GREATER 0 AND NOT %last_played% PRESENT

Code: [Select]
("$strstr(%_path%,'A:\YOUR PATHA\')" GREATER 0 OR "$strstr(%_path%,'B:\YOUR PATHB\')" GREATER 0) AND NOT %last_played% PRESENT
Thank you!!  ;)
The skip thing can not be done
Ohhh well most of the time I skip tracks, listen parts of them unless i like it  :(









Re: How to hide skipped tracks from a dynamic playlist?

Reply #3
If you skip tracks on the first few seconds, as far as I know the play count does not change so you can't do anything about it. If you played at least half of the song, then it counts as played.
But tracks never played before and skipped still get into the previous queries.

You can add a time limit. i.e. if you want tracks not played in the last week or before, then any track skipped and not played during the last week will be in the list too. The limit is you can not automatically send a skipped track to a playlist since skipping is not a recorded event in any way or tags. It can be done with SMP though (save every track played, and compare playing time with track length. whenever it's lower, you have skipped it), but you will have to code it yourself.

Re: How to hide skipped tracks from a dynamic playlist?

Reply #4
Hey there,

Skip Tracks component does have %skip_count% field as of version 1.27, though I have not tried to use it with an auto-playlist...

Code: [Select]
%skip_count% MISSING

(I'm not on PC right now to see if it works)

Cheers

Re: How to hide skipped tracks from a dynamic playlist?

Reply #5
Code: [Select]
("$strstr(%_path%,'A:\YOUR PATHA\')" GREATER 0 OR "$strstr(%_path%,'B:\YOUR PATHB\')" GREATER 0) AND (NOT %last_played% PRESENT OR NOT %skip_count% PRESENT)

Although, on a second thought. What that does is tracking skipping done via component (according to some query), not the user skipping tracks on demand (?).  So we are at the same point for those.

You could, however, replace the playback toolbar with a custom one and... link next track button to an action which increases the skipping count too.

Re: How to hide skipped tracks from a dynamic playlist?

Reply #6
Thank you both for the input  ;)
Quote
not the user skipping tracks on demand (?).  So we are at the same point for those.
Then that means that the snippet wont work if I got it correctly?
Quote
link next track button to an action which increases the skipping count too.
A bit hackish but an interesting idea :D Maybe like in physics, the simpler theory is usually the correct one?

Re: How to hide skipped tracks from a dynamic playlist?

Reply #7
I feel sometimes Foobar is so advanced and limited as the same time, in the sense it can do very great advanced things but I can't adjust it to my needs. Is like mac/ios, if you don't like it you are screwed oj although I do believe there must a a vision in the development of any application.

Re: How to hide skipped tracks from a dynamic playlist?

Reply #8
As noted, you can do it via a SMP script which does increase the skip count and then plays next track. Feel free to ask about it.
You need to update the tags from currently playing track and then play next. You then assign that action to an SMP main menu, and load the script into a panel. Then create a button on any bar and use as action File/Spider Monkey.../X (the menu you associated the script).

Next release of Playlist Tools will have a configurable SMP main menu which also allows you to pre-load your own scripts and assign them to a menu entry -thus resolving the conflict problem-, so all that part would not be required anymore. You sill have to code the tag update/next script though.

With that and my query at top, it would work exactly as you want.

Do agree with your thoughts some times, and that's why I'm releasing my own scripts hahaha

Re: How to hide skipped tracks from a dynamic playlist?

Reply #9
By the way. I do something similar to add a SKIP tag to tracks at the current playback time. The same, associated to a menu and then a button. so you can use it as a example (replacing the SKIP with your tag, and removing all related to the playback time, then adding the next track command):

Code: [Select]
'use strict';

/*
Add Skip Tag From Playback v 1.1 23/06/21
Adds a 'SKIP' tag using current playback. Meant to be used along Skip Track (foo_skip) component.
Has an intelligent switch which sets behavior according to playback time:
- If time > half track length -> Track will play as usually up to the 'SKIP' time, where it jumps to next track.
- If time < half track length -> Track will play from 'SKIP' time to the end.
This is a workaround for using %playback_time% for tagging, since %playback_time% does not work within masstagger scripts.
 */

function skipTagFromPlayback(selItem = new FbMetadbHandleList(fb.GetNowPlaying())) {
if (typeof selItem !== 'undefined' && selItem !== null) {
const countItems = selItem.Count;
if (countItems === 0) {
console.log('No tracks selected.');
return;
}
if (countItems > 1) {
console.log('More than 1 track selected, playback time can only be used for one track at once.');
return;
}
} else {return;}
const currentPlayback = fb.PlaybackTime * 1000;
const time = new Date(currentPlayback).toUTCString().substr(20,5) + '.00'; // doesn't care about ms
const bEnd = currentPlayback > selItem[0].Length * 1000 / 2 ? true : false; // skips from start or end
selItem.UpdateFileInfoFromJSON(JSON.stringify([{'SKIP' : (bEnd ? '' : '-') + time}]));
console.log('Adding SKIP tag to current track: ' + time + (bEnd ? ' (skips end)' : ' (skips start)'));
return time;
}

Re: How to hide skipped tracks from a dynamic playlist?

Reply #10
Quote
With that and my query at top, it would work exactly as you want.

Amazing!!!  8) Thanks you so much!!!

Quote
Do agree with your thoughts some times, and that's why I'm releasing my own scripts hahaha
:thumbs:  :thumbs:
One question could for example the playback component have subcomponents, perhaps it would be simpler say add a subcomponent for  behaviour of skipped tracks? I also ask because I'm learning full-stack JS so in the future I hope to be able to release tweak code my own components.


Re: How to hide skipped tracks from a dynamic playlist?

Reply #11
Quote
With that and my query at top, it would work exactly as you want.

Amazing!!!  8) Thanks you so much!!!

Quote
Do agree with your thoughts some times, and that's why I'm releasing my own scripts hahaha
:thumbs:  :thumbs:
One question could for example the playback component have subcomponents, perhaps it would be simpler say add a subcomponent for  behaviour of skipped tracks? I also ask because I'm learning full-stack JS so in the future I hope to be able to release tweak code my own components.
Not sure if I follow you.
If by component you mean a script, yes, you can obviously have different subroutines in one. You can freely adjust "playback tracks" according to some conditions, one would be the skipping thing.

The only thing which is not "obvious" to create subcomponents for are the callbacks, which apply X function when something happens on foobar. (for example on new track playing). But you can do it by wrapping the callbacks.


Code: [Select]
function onDspPresetChanged() {
if (typeof exportDSP !== 'undefined') {
if (!exportDSP()) {console.log('Error saving DSP entries for http Control integration.')}
}
}
if (typeof on_dsp_preset_changed !== 'undefined') {
const oldFunc = on_dsp_preset_changed;
on_dsp_preset_changed = function() {
oldFunc();
onDspPresetChanged();
}
} else {var on_dsp_preset_changed = onDspPresetChanged;}

You can add an arbitrary number of scripts to the same panel then, which also use the same callback to do X. That's the way I do it on Playlist Tools. It has many scrips unified on one, totally configurable. Some of them need to use the same callback, so that pattern solves the problem.

Now if you mean calling scripts on demand, note the one I posted is only called when you press the button. You don't have to care at all about "sub-scripts" for that. You can have an infinite amount of scripts associated to buttons which edit the now playing track in some way because only one is fired at the same time! (when you press the button). If you want all of them doing something according to X or Y, then you use the callbacks defined at SMP.

To load scripts like sub-modules you have Include . Which is similar to the methods used on browsers (modules).

If you mix both, you can have a main script with a callback which fires on new tracks playing and some scripts "included" which do X or Y according to some conditions. Adding or removing a "component" would be a matter of just adding o removing the "include" line, as long as you use callback wrapping in all of them (and that's exactly what you have at that example I gave you before at #8, with "components" being enabled/disabled via menus -no coding-).

Re: How to hide skipped tracks from a dynamic playlist?

Reply #12
Okey I think I explained very poorly, I will exaplin I think better this time:
Similar to Wordpress where you have plugins like WooCommerce, and then there are plugins for Wocommerce, that's what I meant with "subplugins". Such that for example you can add a subcomponent to "Playback statistics " component , that for example adds x feature to it or tweaks and existing feature.

Thank you so much for explaining I understand what callbacks are but I'm just starting the course (we are in the basics right now) so right now I don't how to implement that yet or understand everything , but hopefully I'm heading that way ;-)

Re: How to hide skipped tracks from a dynamic playlist?

Reply #13
Next release of Playlist Tools will have a configurable SMP main menu which also allows you to pre-load your own scripts and assign them to a menu entry -thus resolving the conflict problem-, so all that part would not be required anymore. You sill have to code the tag update/next script though.

That's exactly what this does. Subplugins can be enabled/disabled. Then subplugins also have presets which can be exported/imported. Then you can create your own presets. And finally you can even add your own subplugins (adding your own script files).

Not getting more customizable than that hahahaha

It could be done in a more universal way, the thing is... here each coder writes its own things not caring so much about compatibility/integration with other plugins. That has changed at least with lastest Bio scripts, which also add functionality to my Map script if both are loaded within foobar.

There could also be an universal plugin with subplugins created by different authors, but the most similar thing right now is Playlist Tools, which is simply all done by me. Don't think there is a community great enough to create subplugins for things and work like wordpress model...

Re: How to hide skipped tracks from a dynamic playlist?

Reply #14
Ohh okey! sorry ^^!!
I will install it and try it out to better get understand it. Thanks ;)

Edit:
Quote
here each coder writes its own things not caring so much about compatibility/integration with other plugins.
But then isn't there extra code work?

Re: How to hide skipped tracks from a dynamic playlist?

Reply #15
A gif explains it better:

Spoiler (click to show/hide)

I have created a framework which allows to merge buttons as independent entities or within a toolbar. If you load the toolbar you can freely load "subplugins", each one doing a different thing. They are taken from a folder, so adding new files to that folder also updates the list within foobar (and have provided several examples that should make easier enough to create your own buttons).

Then some of these plugins (buttons) also use presets, which can be set to totally change the button behavior.

Spoiler (click to show/hide)

Finally you got the big script 'Playlist Tools' which is a collection of tools that can be disable/enabled on demand. Also allow to set SMP menus  (on the next version) with your own "subplugins" or load them within the same panel. There are also presets, which are "user set menu entries" whch can be exported/imported. Some of the scripts also have their own presets which are pretty modular (ones can call others recursively), and are also used by the Search by distance buttons (the previous gif). etc.

Re: How to hide skipped tracks from a dynamic playlist?

Reply #16
Thanks!!! :DDD I will install it and play around.. but I'm understanding a lot more give me a bit of time and I will completely get it.

Re: How to hide skipped tracks from a dynamic playlist?

Reply #17
Ohh okey! sorry ^^!!
I will install it and try it out to better get understand it. Thanks ;)

Edit:
Quote
here each coder writes its own things not caring so much about compatibility/integration with other plugins.
But then isn't there extra code work?
Well... If you ask me, I do think there are a dozen of scripts reinventing the wheel, but to each their own. On the other hand, scripts are in plain text, so anyone could in fact take what's needed from other's coder work.

My point is that apart from some "helpers" (and examples given within SMP) many code is clearly written to be specific to its aim and not meant to be used by others, as general tools. Or  are not precisely readable...

For ex. there was not a menu framework to easily create menus. So there you got +10 scripts using it's own implementation or just creating menus by index numbers which is clearly sub-optimal. Creating Playlist Tools without such framework would have been crazy. For sure... maybe some coders wrote something similar (recently saw Wilb has a less complex implementation on Bio), but it was not shared as an independent framework. You can't just take those js files to create your own menus... and you got no documentation at all.

That's the missing part around this community in my opinion: you have SMP, with clear documentation. But then if you are looking for a base to create X, you have to look for yourself within all the samples, released scripts, etc. and scrap things from here and there. There are no working structures which can be used to accommodate your own things. Don't think coding in c++ equals to coding from zero how to create a window, a list, etc. , here it does.

SMP is not wordpress, so the community is not big enough for asking interoperability of scripts for sure...

On my todo list is planned to release also the map framework (which should also allow arbitrary cloud tags), and the button framework I use. This is just an example of the map being used for a world map or a cloud tag (same framework)

Spoiler (click to show/hide)

Re: How to hide skipped tracks from a dynamic playlist?

Reply #18
Quote
and you got no documentation at all. That's the missing part around this community in my opinion.
:-/
Quote
SMP is not wordpress, so the community is not big enough for asking interoperability of scripts for sure...
Understood. Question ideally should stuff like a menu framework can be defined in the SDK? I know very little about it actually.. so I'm wondering from my ignorance.

Quote
On my todo list is planned to release also the map framework (which should also allow arbitrary cloud tags), and the button framework I use. This is just an example of the map being used for a world map or a cloud tag (same framework)
Damn nice

Re: How to hide skipped tracks from a dynamic playlist?

Reply #19
Quote
SMP is not wordpress, so the community is not big enough for asking interoperability of scripts for sure...
Understood. Question ideally should stuff like a menu framework can be defined in the SDK? I know very little about it actually.. so I'm wondering from my ignorance.
Nope. SMP is the base. Ideally SMP could recommend or have a list of frameworks to work with, but that's beyond my reach  ::)

There are some examples or scripts featured at SMP github web, but meant to be used by final users (not to code over them). Adding more there would have to be done by SMP's author.
If you also think about creating docs, maintaining the wiki (for frameworks which are in fact not his work), etc. that's a ton of work to be done by one. If there was an open wiki that could be edited by anyone, then it could be different.

EDIT: maybe editing this wiki would do. Creating a new category just for SMP
the https://wiki.hydrogenaud.io/index.php?title=Foobar2000:Foobar2000