Author Topic: New plugin: Ghost files! Can API provide? Suggestions needed!  (Read 37821 times)

e-motiv

  • Full Member
  • ***
  • Posts: 189
I have indeed abandoned the project. For my own use and needs, I now add tracks to a "Ghost" playlist before deleting them. It's not perfect and I miss some benefits, but my life is too difficult now with too many free coding projects and the ones from Musicbee always needed to many frequent updates because of incompatible changes (No blame, it is how it is and i am very grateful).

Find the source code here for however wants to take it over.
  Developing @ e-motiv.net       --       Musicbee plugins: Speak Back - Ghost Tracks - Radio Dig

BoringName

  • Sr. Member
  • ****
  • Posts: 916
I've got the basic functionality of this working but it needs A LOT of work. I don't think that source code is from the included DLL as it's missing variable declarations and a few other things that would prevent it compiling regardless of what program it was created in.

The only real benefit I can think of is it could act as a recycle bin. Restoring any info to a previously deleted track not kept in the actual file. Eg) play counts without needing to copy them over manually from a backup.

I don't really know if it's worth keeping a database of every deleted song just in case that event happens?

I was mainly interested as I feel like there is probably some other application for this thing but I can't put my finger on it. Aside from the initial concept of keeping track of songs you don't like.

So if anyone can give me a compelling reason this should exist, I'll have a crack at updating it a bit otherwise I will just release it with the changes I've made to get the basics working.

As is, you need to use a hot key to send any selected files to the ghost tracks database and there is no way to remove them once they are in there. It doesn't track notifications and automatically kick in when you delete something.


Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1733
  • Heal The World
i want the plugin. I recently deleted some files and it resetted play count of that artist. that's why
The only real benefit I can think of is it could act as a recycle bin.
Restoring any info to a previously deleted track not kept in the actual file. Eg) play counts without needing to copy them over manually from a backup.
Specifically for this use-case, I was (and still am) under the impression that MusicBee doesn't remove the stats of deleted tracks until you compress the library.
So unless I've misunderstood, one can always add the deleted track back again to regain the play counts if they so wish to?

When a track's removed from the library, the track info's still retained in the MusicBee database.
See here - sveakul brought it up a while back: https://getmusicbee.com/forum/index.php?topic=39332.0
Strength and Honour (2025)

BoringName

  • Sr. Member
  • ****
  • Posts: 916
When a track's removed from the library, the track info's still retained in the MusicBee database.
See here - sveakul brought it up a while back: https://getmusicbee.com/forum/index.php?topic=39332.0

Right, so it would only be useful if the user selected "Delete from library and computer".

Can anyone think of a another use for having a separate database of track info without any actual track files attached to that data?

BoringName

  • Sr. Member
  • ****
  • Posts: 916
GhostTracks.zip

Here it is if anyone wants to play around. Modified source file included. I've only modified it enough to get it working. There's still a few unused variables and things that need cleaning up.

You need to copy all the DLL's into the plugins folder. For whatever reason getting Sqlite DLL's to compile into a single package is a PITA so I didn't bother.

To use it you have to go into Edit Preferences-> Hotkeys and assign a key to Delete (keep Ghost File). I used shift+delete.

Then just highlight tracks in the main window and use the hotkey, there will be no indication to tell you it copied over. You just have to click on the ghost tracks link in the navigator window and see if the added tracks are there.

Changes
- Updated to use Microsoft.Data.Sqlite (if you want to play with the source code you will need to add this package).
- Instead of using a pre-made database, it will now create a new database dynamically based on the existing FilePropertyTypes and MetaDataTypes in Musicbee. Note this only occurs when no database is present, if new file properties or metadata types are added to Musicbee, they will not be added to the database. It will need to be deleted and let the plugin create a new database to add those columns.
- The database file is located at AppData\Plugins\Ghost Tracks\Ghost Tracks.db

Issues
- For whatever reason the ghost drives folder will not appear in the Folder Browser element until you hit F5 to refresh it. I tried using MB_RefreshPanels() but no luck, I didn't try that hard to solve the issue. It appears just fine in the Navigator element.
- While you can browse through the songs and filter them with the search command etc... just like the rest of the library, because they are not linked to an actual file some things will produce an error eg) The artwork tab and Tag Inspector. Even though you can't look at things like virtual tags they are stored in the ghost tracks database.
- There isn't a current method to remove a track from the ghost tracks database. Once it's in there it staying there unless you delete the database.
- The plugin keeps 20 backups of the database, I meant to reduce this before I compiled but forgot.

That's all I'm going to do with this unless someone gives me a reason like I mentioned earlier.