Skip to content

(feat) Computer feature: use library data model if selected path is watched by library#14687

Draft
ronso0 wants to merge 7 commits into
mixxxdj:mainfrom
ronso0:browse-use-library-data
Draft

(feat) Computer feature: use library data model if selected path is watched by library#14687
ronso0 wants to merge 7 commits into
mixxxdj:mainfrom
ronso0:browse-use-library-data

Conversation

@ronso0
Copy link
Copy Markdown
Member

@ronso0 ronso0 commented Apr 24, 2025

Fixes #14683
Related: #11026 #9897

TL:DR

If the selected path is watched by library, we show it like the other track views (Tracks, Crates, ..).
This gives us the same the view (colums) and editing capabilities.
Watched paths are currently marked with an orange cyan dot:
image

This is really handy if you want to browse your library by path!
Supposed to enhance the Sidebar Bookmarks use case #14508.

Details

If the path is watched, we use an alternative model (derived from LibraryTableModel, uses track data).
Luckily, LibraryTableModel already allows to use an extra search filter (not visible in the searchbox) which allows to filter tracks by directory. (such a filter is also used in Analyze view)
Since BrowseFeature tells the library to load its model on click, switching between the file / track model works flawlessly.

This also introduces SidebarItemDelegate to do the painting.

Note:
The header is different for the file / track views (eg. the file view does not have the rating column), but the views can be made somewhat similar by adjusting the headers once.

  • adopt search query when switching between file / track model
  • add subtle decoration if path item is watched (probably with sidebar delegate from (feat) add Library sidebar bookmarks #14508)
  • cache isWatchedPath property to avoid string comparison when expanding the tree?
  • don't rebuild child tree if watched path is expanded? (update on demand with "Refresh directory tree")
    try to adopt solution from (feat) add Library sidebar bookmarks #14508
  • update TreeItems' isWatchedPath flag when directories have been added to or removed from library
  • also switch view model in that case, if current view is affected?

TODO

@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented Apr 25, 2025

Hehe, I tested this in a session with my personal branch (ie. on top of Sidebar Bookmakrs PR #14508) and it all works as expected!

@ronso0 ronso0 force-pushed the browse-use-library-data branch 4 times, most recently from a713a5f to 791812d Compare April 28, 2025 23:00
@ronso0 ronso0 changed the base branch from main to 2.5 April 28, 2025 23:46
@ronso0 ronso0 changed the base branch from 2.5 to main April 28, 2025 23:47
@ronso0 ronso0 force-pushed the browse-use-library-data branch 4 times, most recently from bfb133e to 5cb3eae Compare April 29, 2025 20:52
@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented May 9, 2025

Cool, I merged this and #14508 Sidebar Bookmarks into my performace branch, and it works nicely!
Just had to adjust the columns, then I had the same tracks view as in Tracks.

@ronso0 ronso0 force-pushed the browse-use-library-data branch from 5cb3eae to d0e02e6 Compare May 9, 2025 23:01
@ronso0 ronso0 force-pushed the browse-use-library-data branch from d0e02e6 to c711781 Compare May 9, 2025 23:24
@Eve00000
Copy link
Copy Markdown
Contributor

Eve00000 commented Jun 4, 2025

Testing on Windows

  • Quick Links & Devices only give a blue dot
  • No data from dbase shown
    see image, properties window is opened from deck 2 genre & comment in dbase, not in trackview
    afbeelding

@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented Jun 4, 2025

Hmm, weird.
Only the folder with the dot uses the library view.
But it should apply to all children since they are subfolders.

I'll check, maybe I messed up something during the rebase.

@ronso0 ronso0 force-pushed the browse-use-library-data branch from c711781 to f28c584 Compare June 4, 2025 14:24
@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented Jun 4, 2025

No data from dbase shown [in subfolders]

Looks like I screwed that up with a fixup..
Fixed, please try again.

@Eve00000
Copy link
Copy Markdown
Contributor

Eve00000 commented Jun 4, 2025

.. Fixed, please try again.

Looks like you fixed it, I only have blue dots, is that correct?
afbeelding

@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented Nov 3, 2025

Yes, that's it.
Root cause is that we extraFilter is wrapped into a SqlNode and SqlNode::match() always returns true.
Hence the check

bool shouldBeInResultSet = searchQuery.isEmpty() ||
        pQuery->match(pTrack);

that is supposed to add dirty tracks is pointless / counter-productive.

I'll file a separate issue if I don't find a quick fix myself.

edit fixed by #15597 in 2.5

@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented Dec 4, 2025

the Computer browse feature should be more of a raw view of the disk and only enhanced by library metadata. Maybe we could gray hidden tracks out?

FWIW hidden tracks are not filtered.
Run a library scan to see the true state of the directory in case you added/removed tracks.

@daschuer
Copy link
Copy Markdown
Member

This is a 2.7 candidate.

@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented Apr 23, 2026

Great 🎉

This is a massive change set, so I understand that's it's been sitting so long.
I skimmed through the commits again and noticed I still need t clean up a few things and can improve comments.
I'll try to do that soonish and let you know when I'm done (remove Draft state).

Let me know if you wanna start reviewing before I'm done.

@ronso0 ronso0 force-pushed the browse-use-library-data branch from 76828f8 to 0435cd6 Compare April 30, 2026 14:22
@ronso0 ronso0 force-pushed the browse-use-library-data branch from 0435cd6 to a1d4161 Compare April 30, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

make Computer / Browse show database data if directory is in library

4 participants