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: Library Tree Discussion (Read 135725 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Library Tree Discussion

Reply #600
^ I've noticed after changing the Options > Behavior tab > Playlist Sort Order box, that you have to reload the panel for changes to take effect correctly.

If that does not work...

Are track filenames starting with %discnumber%.%tracknumber% ? (for %path_sort% to sort correctly)

What happens if you put a custom sort order in that box, like -

Code: [Select]
%album artist%|%date%|%album%|%discnumber%|%tracknumber%|%title%

Re: Library Tree Discussion

Reply #601
that you have to reload the panel for changes to take effect correctly.
I filled in [ %path_sort%] and restarted fb2k to take effect.Or as you say, reloaded panels can work.
For this sort, click OK in the settings panel does not take effect immediately, Wilb, is there any way to improve?

Re: Library Tree Discussion

Reply #602
Happens the same to me with .CUE of FLAC or APE files, shows duplicated. I use the component "Cue Fixer", so in the playlists the albums shows correctly.
Cue Fixer don't work with library :(  (only with playlist view).  Any ideas on how to find a way out?
X
I will try add additional command to callbacks.js:
function on_playlist_items_added(playlistIndex) {
.........
window.Reload();}
.
 It works, but the panels refresh 2 times and blinks. Maybe someone has some better ideas?

Re: Library Tree Discussion

Reply #603
Not an easy task but if you were prepared to rename your files something like...

blah.cue
blah.cue.flac

You could prevent *.cue.flac from being indexed at File>Preferences>Media Library>File types>Exclude.

edit: references inside cue files would obviously need updating. What fun.

Re: Library Tree Discussion

Reply #604
Not an easy task but if you were prepared to rename your files..
I don't want to rename, because all files are seeding in "transmission")
Maybe I can add additional update command in the right place in the code?

Re: Library Tree Discussion

Reply #605
Quote
Maybe I can add additional update command in the right place in the code?
I found a solution!
1. I made a clone of the original package.
2. I added to populate.js in the section
load(list, isArray, add, autoPlay, def_pl, insert) {....}
creating an additional playlist with name "Library folder cache"
Code: [Select]
load(list, isArray, add, autoPlay, def_pl, insert) {
let np_item = -1;
let pid = -1;
const pl_stnd = ppt.libPlaylist.replace(/%view_name%/i, panel.viewName);
let pl_stnd_idx = plman.FindOrCreatePlaylist(pl_stnd, true);
        let cache_2nd_pl = plman.FindOrCreatePlaylist("Library folder cache", true);//my solution

if (!def_pl && plman.ActivePlaylist != -1) pl_stnd_idx = plman.ActivePlaylist;
else if (ppt.activateOnChange) plman.ActivePlaylist = pl_stnd_idx;


if (autoPlay == 4 && plman.PlaylistItemCount(pl_stnd_idx) || autoPlay == 3 && fb.IsPlaying) {
autoPlay = false;
add = true;
}
const items = isArray ? this.getHandleList() : list.Clone();

this.sortIfNeeded(items);
this.selList = items.Clone();
this.selection_holder.SetSelection(this.selList);
const plnIsValid = pl_stnd_idx != -1 && pl_stnd_idx < plman.PlaylistCount;
const pllockRemoveOrAdd = plnIsValid ? plman.GetPlaylistLockedActions(pl_stnd_idx).includes('RemoveItems') || plman.GetPlaylistLockedActions(pl_stnd_idx).includes('ReplaceItems') || plman.GetPlaylistLockedActions(pl_stnd_idx).includes('AddItems') : false;
if (!add && pllockRemoveOrAdd) return;
if (fb.IsPlaying && !add) {
if (ppt.actionMode == 1) {
const pl_playing = `${ppt.libPlaylist} (playing)`;
const pl_playing_idx = plman.FindOrCreatePlaylist(pl_playing, false);
if (plman.PlayingPlaylist == pl_stnd_idx) {
plman.RenamePlaylist(pl_stnd_idx, pl_playing);
plman.RenamePlaylist(pl_playing_idx, pl_stnd);
plman.SetPlaylistSelection(pl_playing_idx, $.range(0, plman.PlaylistItemCount(pl_playing_idx) - 1), true);
plman.RemovePlaylistSelection(pl_playing_idx, false);
plman.InsertPlaylistItems(pl_playing_idx, 0, items, false);
plman.MovePlaylist(pl_playing_idx, pl_stnd_idx);
plman.MovePlaylist(pl_stnd_idx + 1, pl_playing_idx);
                    plman.SetPlaylistSelection(pl_stnd_idx, $.range(0, plman.PlaylistItemCount(pl_stnd_idx) - 1), true);//my solution
                    plman.RemovePlaylistSelection(pl_stnd_idx, false);//my solution
                    plman.InsertPlaylistItems(pl_stnd_idx, 0, items, false);//my solution
                    plman.ClearPlaylist(cache_2nd_pl);//my solution
        plman.InsertPlaylistItems(cache_2nd_pl, 0, items);//my solution
                   
} else {
plman.SetPlaylistSelection(pl_stnd_idx, $.range(0, plman.PlaylistItemCount(pl_stnd_idx) - 1), true);
                    plman.RemovePlaylistSelection(pl_stnd_idx, false);
                    plman.InsertPlaylistItems(pl_stnd_idx, 0, items, false);
                 plman.ClearPlaylist(cache_2nd_pl);//my solution
     plman.InsertPlaylistItems(cache_2nd_pl, 0, items);//my solution
                   
}

plman.ActivePlaylist = pl_stnd_idx;
            
} else if (fb.GetNowPlaying()) {
np_item = items.Find(fb.GetNowPlaying());
let pl_chk = true;
let np;
if (np_item != -1) {
np = plman.GetPlayingItemLocation();
if (np.IsValid) {
if (np.PlaylistIndex != pl_stnd_idx) pl_chk = false;
else pid = np.PlaylistItemIndex;
}
if (pl_chk && pid == -1 && items.Count < 5000) {
if (ui.dui) plman.SetActivePlaylistContext();
const start = Date.now();
for (let i = 0; i < 20; i++) {
if (Date.now() - start > 300) break;
fb.RunMainMenuCommand('Edit/Undo');
np = plman.GetPlayingItemLocation();
if (np.IsValid) {
pid = np.PlaylistItemIndex;
if (pid != -1) break;
}
}
}
}
if (pid != -1) {
plman.ClearPlaylistSelection(pl_stnd_idx);
                    plman.ClearPlaylistSelection(cache_2nd_pl);//my solution
plman.SetPlaylistSelectionSingle(pl_stnd_idx, pid, true);
                    plman.SetPlaylistSelectionSingle(cache_2nd_pl, pid, true);//my solution
plman.RemovePlaylistSelection(pl_stnd_idx, true);
                    plman.RemovePlaylistSelection(cache_2nd_pl, true);//my solution
const it = items.Clone();
items.RemoveRange(np_item, items.Count);
it.RemoveRange(0, np_item + 1);
if (plman.PlaylistItemCount(pl_stnd_idx) < 5000) plman.UndoBackup(pl_stnd_idx);
plman.InsertPlaylistItems(pl_stnd_idx, 0, items);
                    plman.InsertPlaylistItems(cache_2nd_pl, 0, items);//my solution
plman.InsertPlaylistItems(pl_stnd_idx, plman.PlaylistItemCount(pl_stnd_idx), it);
                    plman.InsertPlaylistItems(cache_2nd_pl, plman.PlaylistItemCount(pl_stnd_idx), it);//my solution
                   
} else {
if (plman.PlaylistItemCount(pl_stnd_idx) < 5000) plman.UndoBackup(pl_stnd_idx);
plman.ClearPlaylist(pl_stnd_idx);
                    plman.ClearPlaylist(cache_2nd_pl);//my solution
plman.InsertPlaylistItems(pl_stnd_idx, 0, items);
plman.InsertPlaylistItems(cache_2nd_pl, 0, items);//my solution 
                 
}
}
} else if (!add) {
if (plman.PlaylistItemCount(pl_stnd_idx) < 5000) plman.UndoBackup(pl_stnd_idx);
plman.ClearPlaylist(pl_stnd_idx);
            plman.ClearPlaylist(cache_2nd_pl);//my solution
plman.InsertPlaylistItems(pl_stnd_idx, 0, items);
            plman.InsertPlaylistItems(cache_2nd_pl, 0, items);//my solution
plman.SetPlaylistFocusItem(pl_stnd_idx, 0);
//plman.SetPlaylistFocusItem(cache_2nd_pl, 0);//my solution

} else {
if (plman.PlaylistItemCount(pl_stnd_idx) < 5000) plman.UndoBackup(pl_stnd_idx);
plman.InsertPlaylistItems(pl_stnd_idx, !insert ? plman.PlaylistItemCount(pl_stnd_idx) : plman.GetPlaylistFocusItemIndex(pl_stnd_idx), items, true);
            plman.InsertPlaylistItems(cache_2nd_pl, !insert ? plman.PlaylistItemCount(pl_stnd_idx) : plman.GetPlaylistFocusItemIndex(pl_stnd_idx), items, true);//my solution
const f_ix = !insert || plman.GetPlaylistFocusItemIndex(pl_stnd_idx) == -1 ? plman.PlaylistItemCount(pl_stnd_idx) - items.Count : plman.GetPlaylistFocusItemIndex(pl_stnd_idx) - items.Count;
plman.SetPlaylistFocusItem(pl_stnd_idx, f_ix);
plman.EnsurePlaylistItemVisible(pl_stnd_idx, f_ix);

         
}
if (autoPlay) {
const c = (plman.PlaybackOrder == 3 || plman.PlaybackOrder == 4) ? Math.ceil(plman.PlaylistItemCount(pl_stnd_idx) * Math.random() - 1) : 0;
plman.ExecutePlaylistDefaultAction(pl_stnd_idx, c);
}
}
3. In the 1st panel I added a moded panel: source=library (view by folder structure), in behaviour tab set default playlist=Library artist cache (mode=browser).
4. In the 2nd panel - original panel: source=playlist "Library folder cache", in behaviour tab set default playlist="Library artist cache"  (mode=browser).
5. In the 3d panel - original panel: source=playlist "Library artist cache", in behaviour tab set default playlist="Library album cache"  (mode=browser).
Now Cue_fixer works fine with CUE & view by folder structure: clicking in the 1st panel creates 2 playlists: "Library folder cache" and Library artist cache. The 2nd panel is linked to the "Library folder cache" playlist. The 3rd panel is linked to the "Library artist cache" playlist. Clicking in the 3rd pane creates an independent "Library album cache" playlist.
X
P.s. Maybe the author will do a better job in the next update!

Re: Library Tree Discussion

Reply #606
I would appreciate to be able to identify the current branch in a secondary node.

In my scenario, I tag tracks with the birth place and, sometimes, the background of people (with the three-letter-code for Regor's World-Map) as follows:

%composer-iso3166% ("SVN; Slovenia" for Hugo Wolf)
%composer-iso3166-b% ("AUT; Austria" for Hugo Wolf)
%lyricist-iso3166% ("BRA; Brasil" for Alfredo Le Pera)
%lyricist-iso3166-b% ("ARG; Argentina" for Alfredo Le Pera)
%artist-iso3166% ("USA; United States of America" for Cathy Berberian)
%artist-iso3166-b% ("ARM; Armenia" for Cathy Berberian)
%group-iso3166% ("FRA; France" for Orange Blossom)
%group-iso3166-b% ("EGY; Egypt" for Orange Blossom)
%producer-iso3166% ("DZA; Algeria" for Hector Zazou)
%producer-iso3166-b% ("FRA; France" for Hector Zazou)

And I'm trying to set some branches:

Country
   Composers & Lyricists
   or
   Performers & Producers
      By their birthplace
      or
      By their background
         Name
            Album

but I'm loosing track of where I am in each step because tracks are indeed filtered including maybe a composer of the "right" country performed by an artist of a different one, so I'd need to know which is the right country to further filter tracks (so that these tracks get listed under the composer's name but the performer's name doesn't get highlighted as for the same nationality).

Spoiler (click to show/hide)

I've also tried to write all nodes at once, when parsing tracks in the topmost filter, but failed when going for successive criteria because all "¦" must be resolved before any "|", I guess:

%country%|'Composers & Lyricists'|'By their birthplace'|%composer%|%album%|%<track>%
¦
%country%|'Performers & Producers'|'By their birthplace'|%artist%|%album%|%<track>%

Thanks in advance!

Re: Library Tree Discussion

Reply #607
Hi,
I recently switched from the old facets to library tree. I'm getting used to it, trying to recreate my old setup with this new tool. 
I use several library tree panels as facets, linked together as explained in the help. It's working as intended.
One thing I miss, is being able to reorder my views by number of sub-items. 
For example, I use a lot of different Genre tags, and sometimes I want to browse my facet panel alphabetically, sometimes I want to order by the number of albums in that genre. There is no such option in the "sort selected view" submenu. Is there some tweak to make it possible? 

X

Thank you for your help, and thanks to the amazing work you're all doing!

Re: Library Tree Discussion

Reply #608
I've got a problem with something I'm trying to do: I want to rely on folder organization rather than tagging to organize and navigate my music library cause it's too big to go through every album and add the tags, at least for now. So I basically want to set up foobar to work as a folder explorer. This is my library's structure:

My Music
  [Artist]
    [Type of audio (vinyl, CD, hi-res, etc.)]
        [Download, e.g. "complete vinyl collection", "discography", sometimes individual albums]
            [Year] - [Album]
                Files

So I've created 4 Library Tree panels, set each as the source of the next one, and selected folder structure view for all of them. But rather than acting as I expected, with each panel taking me further down the folder structure, instead they all show the same root directory and don't interact. What do I have to do to make each panel act as a filter for the next one? Also, is there a way to show nothing in the 3rd panel if what is selected in the 2nd panel is an album folder instead of folder with a collection of albums?

Re: Library Tree Discussion

Reply #609
Not an easy task but if you were prepared to rename your files..
I don't want to rename, because all files are seeding in "transmission")
Maybe I can add additional update command in the right place in the code?
Dunno about Transmission, but with qBittorrent you can rename files and folders of torrents from within qBittorrent and still have them be recognized by the client and seeded. I do it all the time, I rename the contents of downloads to conform with my music library's organization and also rely on qBT to keep track of the files, hash check them to ensure data integrity etc.

Re: Library Tree Discussion

Reply #610
Not an easy task but if you were prepared to rename your files..
I don't want to rename, because all files are seeding in "transmission")
Maybe I can add additional update command in the right place in the code?
Dunno about Transmission, but with qBittorrent you can rename files and folders of torrents from within qBittorrent and still have them be recognized by the client and seeded. I do it all the time, I rename the contents of downloads to conform with my music library's organization and also rely on qBT to keep track of the files, hash check them to ensure data integrity etc.

Yeah, Transmission is a good torrent client but lacks of management functions.
You can try to export the torrents from Transmission to qBittorrent with transmission-to-qbittorrent and change the structure with the rename and move features of qBittorrent. Is very useful to use alongside foobar2000 and Kodi. You can have custom names and folder structure according to your needs and continue to seed the files without problem

Re: Library Tree Discussion

Reply #611
Not an easy task but if you were prepared to rename your files..
I don't want to rename, because all files are seeding in "transmission")
Maybe I can add additional update command in the right place in the code?
Dunno about Transmission, but with qBittorrent you can rename files and folders of torrents from within qBittorrent and still have them be recognized by the client and seeded. I do it all the time, I rename the contents of downloads to conform with my music library's organization and also rely on qBT to keep track of the files, hash check them to ensure data integrity etc.

Yeah, Transmission is a good torrent client but lacks of management functions.
You can try to export the torrents from Transmission to qBittorrent with transmission-to-qbittorrent and change the structure with the rename and move features of qBittorrent. Is very useful to use alongside foobar2000 and Kodi. You can have custom names and folder structure according to your needs and continue to seed the files without problem
How do you customize folder structure with qBT? Didn't know that was possible and it would be useful for the occasional torrent where the uploader chose an [Artist name]/[Torrent name]/[Albums] structure instead of the usual [Torrent name]/[Albums] one.

Re: Library Tree Discussion

Reply #612
How do you customize folder structure with qBT? Didn't know that was possible and it would be useful for the occasional torrent where the uploader chose an [Artist name]/[Torrent name]/[Albums] structure instead of the usual [Torrent name]/[Albums] one.

Without problem.
If the torrent is already downloaded, you can move it to another folder or rename the files or folders inside it and continue to seed.
If it is a new torrent if you set torrent managing to manual, it opens a window that gives you a lot of options to select where it will be saved and how (renaming, make a folder, doesn't create a folder, etc)
also you can set various additional download folders (called categories) to music, movies, tv shows...
And if the page have an RSS, automatize the download with filters.
One thing that I like is that the program make a difference between the name of the torrent and the folders that create. So you can have the original name XXX-repack-group-page and rename the folder that create to Artist - Year - Album for example.
It not as advanced as foobar2000 (you can't script with tags) but with a little of planification you can have a very clean folder structure that can be used with foobar2000 and kodi, if you don't modify the files with these programs of course. If you rename or tag the files with foobar the torrent will not work anymore. In kodi is not a problem because it uses .nfo files and in foobar you can use external tag plugin to avoid file modification.
For Kodi for example.
I have two categories Movies and TV-Shows that points to the folders that kodi needs.
For TV shows I made folders like tv-show (year)
To download the episodes as they was aired a Sesion folder inside.
then when i download one new is as easy as select the tv-show category, the show folder and the session folder and they are ready to be read by kodi.
If it is a entire season i select the show folder and then i rename the torrent folder to the corresponding session and ready.
Once you have this routine, (two-three clicks per torrent) you have all files ready to run kodi and scrap all the info (posters, titles, actors, etc) and at the same time continue to seed the torrent and preserve the original name to know where you download it from or to search the correct subtitles, etc
for foobar2000 the same but more easy because you only need to point the download to the artist album folder and rename the torent folder to year - album

Re: Library Tree Discussion

Reply #613
I switched from Facets to Library Tree recently and found an issue with my hotkeys, namely I've had play/pause bound to the spacebar and it's prioritized over typing in Library Tree's search function meaning I can't use any spaces in my search. The default search bars in foobar2000 and Facets let me type spaces normally without affecting playback. Is there a solution I just haven't found or do I just have to deal with it? Or any chance this could be changed in an update?

Re: Library Tree Discussion

Reply #614
I switched from Facets to Library Tree recently and found an issue with my hotkeys, namely I've had play/pause bound to the spacebar and it's prioritized over typing in Library Tree's search function meaning I can't use any spaces in my search. The default search bars in foobar2000 and Facets let me type spaces normally without affecting playback. Is there a solution I just haven't found or do I just have to deal with it? Or any chance this could be changed in an update?
No, space hotkey will always be preferred over typing (unless I miss something, SMP doesn't block other hotkeys being applied, and this problem is present on all scripts).

But you can press Shift + Space and hotkey will be skipped. It will write the space fine on the panel too.

 

Re: Library Tree Discussion

Reply #615
I switched from Facets to Library Tree recently and found an issue with my hotkeys, namely I've had play/pause bound to the spacebar and it's prioritized over typing in Library Tree's search function meaning I can't use any spaces in my search. The default search bars in foobar2000 and Facets let me type spaces normally without affecting playback. Is there a solution I just haven't found or do I just have to deal with it? Or any chance this could be changed in an update?
No, space hotkey will always be preferred over typing (unless I miss something, SMP doesn't block other hotkeys being applied, and this problem is present on all scripts).

But you can press Shift + Space and hotkey will be skipped. It will write the space fine on the panel too.

I see. Shift + Space is very helpful though, thank you.