Quodlibet: Hidden (non-playlist) file in playlist dir moved to ./backup/ and replaced a .xspf

Created on 20 Apr 2021  路  5Comments  路  Source: quodlibet/quodlibet

Because of #708 constantly deleting the contents of my playlists, I keep the ~/.quodlibet/playlists folder under git version control so I can easily restore them.

Since the the introduction of XSPF support, my ~/.quodlibet/playlists/.gitignore file is being moved to ./backup/ and replaced a .gitignore.xspf file

Steps to reproduce

Put ~/.quodlibet/playlists folder under git version control and added .backup to .gitignore
Open quodlibet

Expected Output

~/.quodlibet/playlists/.gitignore file is ignored because it is a hidden file

Actual Output

~/.quodlibet/playlists/.gitignore file is moved to ./backup/ and replaced by a .gitignore.xspf file

Test System

Which version of Quod Libet?

4.4.0

Which operating system

Ubuntu 20.04

bug playlists

All 5 comments

@declension I thought about the exact same change you made, but, unless I'm missing something (I'm tired), it doesn't address the possibility of playlist names starting with a dot. Seems like they will now be ignored.

Just tried, and there's nothing preventing me from creating a playlist that starts with a dot (and of course, they may already exist from long ago). File name is: .eba.xspf

Hi @CreamyCookie. Yes, it's true; I figured almost nobody would be using these given that ls and so on hides them.

But yes _could_ be a problem here for some: ...and Justice for All is an (album) name that would screw up for sure.

Pushing a fix / tightening of these rules later...
Thanks

I hate to be pedantic, but I don't think the fix solves the issue. ..a will not match, but .__. will (i could see someone using that for sad songs), and of course, .aaa. or .dot will also still match and suddenly not appear in the playlist view.

Maybe it's unlikely that many users have such names, but the more I think about it, simply ignoring .gitignore seems like a better solution (since that name seems extremely unlikely to be a playlist name).

An alternative solution would be to check "is this empty or a correct playlist containing tracks that exist" and if it isn't to ignore it.

Hope you don't mind these unsolicited code reviews too much :sweat_smile:

The thing is it's not _just_ .gitignore.

.gitattributes
.gitkeep (not likely really but possible)
.bashrc / .zshrc / .vimrc / .profile etc (also unlikely to be here I suppose)

Plus similar for Mercurial etc .hgignore (which we used to use in QL, FWIW) / .bzrignore

Guess I could dream up a regex to handle most of this though, dunno.

The thing is it's not just .gitignore.

Yes, of course!

Guess I could dream up a regex to handle most of this though, dunno.

It seems like ignoring only the names you mentioned is vastly better than ignoring all files that start with a dot.

We might still miss some and have to update later, but that will likely happen very rarely.

@declension What about the alternative solution I mentioned? I guess it's probably much harder or more bothersome to do than I think.

An alternative solution would be to check "is this file empty, or a correct playlist containing tracks that exist" and if it isn't to ignore it.

Was this page helpful?
0 / 5 - 0 ratings