jacquesh / foo_openlyrics

An open-source lyric display panel for foobar2000
MIT License
401 stars 24 forks source link

Tags that contain a '/' cause directories to be created that are undeleteable #273

Closed purdym closed 11 months ago

purdym commented 1 year ago

If the 'title' tag in a file has a '/' in it, the lyrics get saved to a folder that is not deleteable. If the title tag is a/b, instead of file being created a folder called 'b' is created. Probably with a special character in it. The folder b is not deleteable.

NO combination of rmdir, get-item remove-item, or GUI commands can delete or rename the folder.

Steps to reproduce

  1. have a title tag with '/' in it

Expected behavior

Lyrics get saved to a file.

Versions

Additional information

Sorry, I don't want to reproduce the error. I can not find a solution to delete the folder after it is created. error 0 error 1 error 2 error 3 error 4

jacquesh commented 1 year ago

If the 'title' tag in a file has a '/' in it, the lyrics get saved to a folder that is not deleteable.

The folder creation is intentional (you can change the format to replace the slashes if you don't want that behaviour). The inability to delete them though, obviously is not.

Let's just get some obvious checks out of the way to start with:

  1. What happens when you try to delete it from explorer? You say that no "GUI commands" delete it, I assume that's what you're referring to but I'm just checking because you didn't have a screenshot of that case.
  2. Are you absolutely sure you're trying to delete the correct filename? For example in your last screenshot you've got a trailing space but it's not obvious from the dir above whether that's correct and the error it gives is that the file doesn't exist (rather than that it couldn't be deleted, although I have not checked myself if that's actually what it would give in that case). Can you dir/ls the undeletable folder (which should contain the actual lyrics file)?
  3. It looks like this is writing to a network drive. Is that true and does the same thing happen on a regular local disk? (Network drives sometimes have weird permissions issues, especially if they're not powered by Windows under the hood and expect linux-style permissions attributes)
purdym commented 1 year ago

Thank you for getting back to me.

Let me answer these one at time, best I can.

1

From the machine that stores the data (not network drive)

It will not delete:

From: Jacques Heunis @.*** Sent: June 17, 2023 2:30 AM To: jacquesh/foo_openlyrics Cc: purdym; Author Subject: Re: [jacquesh/foo_openlyrics] Tags that contain a '/' cause directories to be created that are undeleteable (Issue #273)

If the 'title' tag in a file has a '/' in it, the lyrics get saved to a folder that is not deleteable.

The folder creation is intentional (you can change the format to replace the slashes if you don't want that behaviour). The inability to delete them though, obviously is not.

Let's just get some obvious checks out of the way to start with:

  1. What happens when you try to delete it from explorer? You say that no "GUI commands" delete it, I assume that's what you're referring to but I'm just checking because you didn't have a screenshot of that case.
  2. Are you absolutely sure you're trying to delete the correct filename? For example in your last screenshot you've got a trailing space but it's not obvious from the dir above whether that's correct and the error it gives is that the file doesn't exist (rather than that it couldn't be deleted, although I have not checked myself if that's actually what it would give in that case). Can you dir/ls the undeletable folder (which should contain the actual lyrics file)?
  3. It looks like this is writing to a network drive. Is that true and does the same thing happen on a regular local disk? (Network drives sometimes have weird permissions issues, especially if they're not powered by Windows under the hood and expect linux-style permissions attributes)

— Reply to this email directly, view it on GitHub https://github.com/jacquesh/foo_openlyrics/issues/273#issuecomment-1595657647 , or unsubscribe https://github.com/notifications/unsubscribe-auth/BAUDGQN3MYNVOLVPNUKJEDLXLVMH5ANCNFSM6AAAAAAZJVAZ2E . You are receiving this because you authored the thread. https://github.com/notifications/beacon/BAUDGQLNG4GNRUHIU5DB47TXLVMH5A5CNFSM6AAAAAAZJVAZ2GWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTS7DPG26.gif Message ID: @.***>

-- This email has been checked for viruses by Avast antivirus software. www.avast.com

purdym commented 1 year ago

Hello

2.

Yes, I’m sure I’m trying to delete the correct file. Both through the GUI and from command prompt and from powershell. I’ve typed the name and used tab completion.

3.

I’ve run all the commands locally on my media server and on a client machine. Neither are able to delete the folders.

Miles

From: Jacques Heunis @.*** Sent: June 17, 2023 2:30 AM To: jacquesh/foo_openlyrics Cc: purdym; Author Subject: Re: [jacquesh/foo_openlyrics] Tags that contain a '/' cause directories to be created that are undeleteable (Issue #273)

If the 'title' tag in a file has a '/' in it, the lyrics get saved to a folder that is not deleteable.

The folder creation is intentional (you can change the format to replace the slashes if you don't want that behaviour). The inability to delete them though, obviously is not.

Let's just get some obvious checks out of the way to start with:

  1. What happens when you try to delete it from explorer? You say that no "GUI commands" delete it, I assume that's what you're referring to but I'm just checking because you didn't have a screenshot of that case.
  2. Are you absolutely sure you're trying to delete the correct filename? For example in your last screenshot you've got a trailing space but it's not obvious from the dir above whether that's correct and the error it gives is that the file doesn't exist (rather than that it couldn't be deleted, although I have not checked myself if that's actually what it would give in that case). Can you dir/ls the undeletable folder (which should contain the actual lyrics file)?
  3. It looks like this is writing to a network drive. Is that true and does the same thing happen on a regular local disk? (Network drives sometimes have weird permissions issues, especially if they're not powered by Windows under the hood and expect linux-style permissions attributes)

— Reply to this email directly, view it on GitHub https://github.com/jacquesh/foo_openlyrics/issues/273#issuecomment-1595657647 , or unsubscribe https://github.com/notifications/unsubscribe-auth/BAUDGQN3MYNVOLVPNUKJEDLXLVMH5ANCNFSM6AAAAAAZJVAZ2E . You are receiving this because you authored the thread. https://github.com/notifications/beacon/BAUDGQLNG4GNRUHIU5DB47TXLVMH5A5CNFSM6AAAAAAZJVAZ2GWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTS7DPG26.gif Message ID: @.***>

-- This email has been checked for viruses by Avast antivirus software. www.avast.com

jacquesh commented 1 year ago

@purdym I'll have to try it out myself to see if I can reproduce this locally but I haven't gotten a chance yet. For now though I just wanted to point out that it seems like your replies were meant to have images in them (implied by the text and large open whitespace), but they don't show up for me.

Another thing that randomly occurred to me is permissions. It's a bit of a long shot but are you possibly running fb2k as admin? That would probably cause any files/folders it creates to be owned by the admin user rather than you user, which then might not have permission to delete them. You can check this by right-clicking on the folder -> Properties -> Security -> Advanced and seeing who is listed as the owner (at the top of the resulting dialog) as well as the permissions for other users below, and compare that to the user you're running as when you're trying to delete the file.

purdym commented 1 year ago

Resending to see if you get the images…

2.

Yes, I’m sure I’m trying to delete the correct file. Both through the GUI and from command prompt and from powershell. I’ve typed the name and used tab completion.

@.***

3.

I’ve run all the commands locally on my media server and on a client machine. Neither are able to delete the folders.

Miles

From: Jacques Heunis @.*** Sent: June 17, 2023 2:30 AM To: jacquesh/foo_openlyrics Cc: purdym; Author Subject: Re: [jacquesh/foo_openlyrics] Tags that contain a '/' cause directories to be created that are undeleteable (Issue #273)

If the 'title' tag in a file has a '/' in it, the lyrics get saved to a folder that is not deleteable.

The folder creation is intentional (you can change the format to replace the slashes if you don't want that behaviour). The inability to delete them though, obviously is not.

Let's just get some obvious checks out of the way to start with:

  1. What happens when you try to delete it from explorer? You say that no "GUI commands" delete it, I assume that's what you're referring to but I'm just checking because you didn't have a screenshot of that case.
  2. Are you absolutely sure you're trying to delete the correct filename? For example in your last screenshot you've got a trailing space but it's not obvious from the dir above whether that's correct and the error it gives is that the file doesn't exist (rather than that it couldn't be deleted, although I have not checked myself if that's actually what it would give in that case). Can you dir/ls the undeletable folder (which should contain the actual lyrics file)?
  3. It looks like this is writing to a network drive. Is that true and does the same thing happen on a regular local disk? (Network drives sometimes have weird permissions issues, especially if they're not powered by Windows under the hood and expect linux-style permissions attributes)

— Reply to this email directly, view it on GitHub https://github.com/jacquesh/foo_openlyrics/issues/273#issuecomment-1595657647 , or unsubscribe https://github.com/notifications/unsubscribe-auth/BAUDGQN3MYNVOLVPNUKJEDLXLVMH5ANCNFSM6AAAAAAZJVAZ2E . You are receiving this because you authored the thread.https://github.com/notifications/beacon/BAUDGQLNG4GNRUHIU5DB47TXLVMH5A5CNFSM6AAAAAAZJVAZ2GWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTS7DPG26.gifMessage ID: @.***>

-- This email has been checked for viruses by Avast antivirus software. www.avast.com

purdym commented 1 year ago

Resending with images as attacments.

Miles

From: Jacques Heunis @.*** Sent: June 17, 2023 2:30 AM To: jacquesh/foo_openlyrics Cc: purdym; Author Subject: Re: [jacquesh/foo_openlyrics] Tags that contain a '/' cause directories to be created that are undeleteable (Issue #273)

If the 'title' tag in a file has a '/' in it, the lyrics get saved to a folder that is not deleteable.

The folder creation is intentional (you can change the format to replace the slashes if you don't want that behaviour). The inability to delete them though, obviously is not.

Let's just get some obvious checks out of the way to start with:

  1. What happens when you try to delete it from explorer? You say that no "GUI commands" delete it, I assume that's what you're referring to but I'm just checking because you didn't have a screenshot of that case.
  2. Are you absolutely sure you're trying to delete the correct filename? For example in your last screenshot you've got a trailing space but it's not obvious from the dir above whether that's correct and the error it gives is that the file doesn't exist (rather than that it couldn't be deleted, although I have not checked myself if that's actually what it would give in that case). Can you dir/ls the undeletable folder (which should contain the actual lyrics file)?
  3. It looks like this is writing to a network drive. Is that true and does the same thing happen on a regular local disk? (Network drives sometimes have weird permissions issues, especially if they're not powered by Windows under the hood and expect linux-style permissions attributes)

— Reply to this email directly, view it on GitHub https://github.com/jacquesh/foo_openlyrics/issues/273#issuecomment-1595657647 , or unsubscribe https://github.com/notifications/unsubscribe-auth/BAUDGQN3MYNVOLVPNUKJEDLXLVMH5ANCNFSM6AAAAAAZJVAZ2E . You are receiving this because you authored the thread.https://github.com/notifications/beacon/BAUDGQLNG4GNRUHIU5DB47TXLVMH5A5CNFSM6AAAAAAZJVAZ2GWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTS7DPG26.gifMessage ID: @.***>

-- This email has been checked for viruses by Avast antivirus software. www.avast.com

purdym commented 1 year ago

Hello,

Re: permissions

I’m not great with window’s permission. I’m a linux guy by trade.

But, that computer only has one account, that account is an admin account.

Miles

From: Jacques Heunis @.*** Sent: June 18, 2023 9:18 AM To: jacquesh/foo_openlyrics Cc: purdym; Mention Subject: Re: [jacquesh/foo_openlyrics] Tags that contain a '/' cause directories to be created that are undeleteable (Issue #273)

@purdym https://github.com/purdym I'll have to try it out myself to see if I can reproduce this locally but I haven't gotten a chance yet. For now though I just wanted to point out that it seems like your replies were meant to have images in them (implied by the text and large open whitespace), but they don't show up for me.

Another thing that randomly occurred to me is permissions. It's a bit of a long shot but are you possibly running fb2k as admin? That would probably cause any files/folders it creates to be owned by the admin user rather than you user, which then might not have permission to delete them. You can check this by right-clicking on the folder -> Properties -> Security -> Advanced and seeing who is listed as the owner (at the top of the resulting dialog) as well as the permissions for other users below, and compare that to the user you're running as when you're trying to delete the file.

— Reply to this email directly, view it on GitHub https://github.com/jacquesh/foo_openlyrics/issues/273#issuecomment-1596165612 , or unsubscribe https://github.com/notifications/unsubscribe-auth/BAUDGQOGOBWKYYKDMIB4DDTXL4E2HANCNFSM6AAAAAAZJVAZ2E . You are receiving this because you were mentioned. https://github.com/notifications/beacon/BAUDGQJE32EKRMAZ4UZC5GDXL4E2HA5CNFSM6AAAAAAZJVAZ2GWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTS7EOG6Y.gif Message ID: @.***>

-- This email has been checked for viruses by Avast antivirus software. www.avast.com

purdym commented 1 year ago

Hello,

I don’t know what I did differently, but I managed to fix one of the errors.

I put the directory name in quotes, with space / \ at the end. I’m sure I tried that before.

H:\Media\Audio\p\Pete Townshend\Pete Townshend - Hi-Res Masters [FLAC]>rmdir "Pete Townshend - Baba O'Riley (Instrumental Version "

The system cannot find the file specified.

H:\Media\Audio\p\Pete Townshend\Pete Townshend - Hi-Res Masters [FLAC]>rmdir "Pete Townshend - Baba O'Riley (Instrumental Version \/"

H:\Media\Audio\p\Pete Townshend\Pete Townshend - Hi-Res Masters [FLAC]>dir

Volume in drive H is Audio

Volume Serial Number is 482D-776E

Directory of H:\Media\Audio\p\Pete Townshend\Pete Townshend - Hi-Res Masters [FLAC]

2023-06-18 06:55 PM

.

2023-06-14 10:02 PM

..

           0 File(s)              0 bytes

           2 Dir(s)  2,885,592,809,472 bytes free

H:\Media\Audio\p\Pete Townshend\Pete Townshend - Hi-Res Masters [FLAC]>cd ..

H:\Media\Audio\p\Pete Townshend>

From: Jacques Heunis @.*** Sent: June 18, 2023 9:18 AM To: jacquesh/foo_openlyrics Cc: purdym; Mention Subject: Re: [jacquesh/foo_openlyrics] Tags that contain a '/' cause directories to be created that are undeleteable (Issue #273)

@purdym https://github.com/purdym I'll have to try it out myself to see if I can reproduce this locally but I haven't gotten a chance yet. For now though I just wanted to point out that it seems like your replies were meant to have images in them (implied by the text and large open whitespace), but they don't show up for me.

Another thing that randomly occurred to me is permissions. It's a bit of a long shot but are you possibly running fb2k as admin? That would probably cause any files/folders it creates to be owned by the admin user rather than you user, which then might not have permission to delete them. You can check this by right-clicking on the folder -> Properties -> Security -> Advanced and seeing who is listed as the owner (at the top of the resulting dialog) as well as the permissions for other users below, and compare that to the user you're running as when you're trying to delete the file.

— Reply to this email directly, view it on GitHub https://github.com/jacquesh/foo_openlyrics/issues/273#issuecomment-1596165612 , or unsubscribe https://github.com/notifications/unsubscribe-auth/BAUDGQOGOBWKYYKDMIB4DDTXL4E2HANCNFSM6AAAAAAZJVAZ2E . You are receiving this because you were mentioned. https://github.com/notifications/beacon/BAUDGQJE32EKRMAZ4UZC5GDXL4E2HA5CNFSM6AAAAAAZJVAZ2GWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTS7EOG6Y.gif Message ID: @.***>

-- This email has been checked for viruses by Avast antivirus software. www.avast.com

purdym commented 1 year ago

Hello,

If I start back at the beginning, perhaps this is helpful.

Attached is the tag information for the Patti Smith file. You can see the title contains a : and / which, AFAIK, are illegal in windows.

So I’m assuming the code created a ‘file’ with those characters? That they do not get stripped out?

Miles

From: Jacques Heunis @.*** Sent: June 18, 2023 9:18 AM To: jacquesh/foo_openlyrics Cc: purdym; Mention Subject: Re: [jacquesh/foo_openlyrics] Tags that contain a '/' cause directories to be created that are undeleteable (Issue #273)

@purdym https://github.com/purdym I'll have to try it out myself to see if I can reproduce this locally but I haven't gotten a chance yet. For now though I just wanted to point out that it seems like your replies were meant to have images in them (implied by the text and large open whitespace), but they don't show up for me.

Another thing that randomly occurred to me is permissions. It's a bit of a long shot but are you possibly running fb2k as admin? That would probably cause any files/folders it creates to be owned by the admin user rather than you user, which then might not have permission to delete them. You can check this by right-clicking on the folder -> Properties -> Security -> Advanced and seeing who is listed as the owner (at the top of the resulting dialog) as well as the permissions for other users below, and compare that to the user you're running as when you're trying to delete the file.

— Reply to this email directly, view it on GitHub https://github.com/jacquesh/foo_openlyrics/issues/273#issuecomment-1596165612 , or unsubscribe https://github.com/notifications/unsubscribe-auth/BAUDGQOGOBWKYYKDMIB4DDTXL4E2HANCNFSM6AAAAAAZJVAZ2E . You are receiving this because you were mentioned. https://github.com/notifications/beacon/BAUDGQJE32EKRMAZ4UZC5GDXL4E2HA5CNFSM6AAAAAAZJVAZ2GWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTS7EOG6Y.gif Message ID: @.***>

-- This email has been checked for viruses by Avast antivirus software. www.avast.com

purdym commented 1 year ago

Sorry to spam you tonight, I’ve fixed it.

H:\Media\Audio\p\Patti Smith\Patti Smith - Hi-Res Masters [FLAC]>rmdir "Patti Smith - Land- Horses \/\ Land of a Thousand Dances \/"
H:\Media\Audio\p\Patti Smith\Patti Smith - Hi-Res Masters [FLAC]>rmdir "Patti Smith - Land- Horses \/"
H:\Media\Audio\p\Patti Smith\Patti Smith - Hi-Res Masters [FLAC]>dir
Volume in drive H is Audio
Volume Serial Number is 482D-776E
Directory of H:\Media\Audio\p\Patti Smith\Patti Smith - Hi-Res Masters [FLAC]
2023-06-18  07:49 PM    <DIR>          .
2023-06-18  07:31 PM    <DIR>          ..
               0 File(s)              0 bytes
               2 Dir(s)  2,885,592,809,472 bytes free
H:\Media\Audio\p\Patti Smith\Patti Smith - Hi-Res Masters [FLAC]>

Would it be appropriate for the code to remove all special characters before creating a file?

I’ll let you look at this now and decide. I’ve fixed my problems.

Thank you for taking the time to help me. And I do enjoy the plugin J

Miles

From: Jacques Heunis @.*** Sent: June 18, 2023 9:18 AM To: jacquesh/foo_openlyrics Cc: purdym; Mention Subject: Re: [jacquesh/foo_openlyrics] Tags that contain a '/' cause directories to be created that are undeleteable (Issue #273)

@purdym https://github.com/purdym I'll have to try it out myself to see if I can reproduce this locally but I haven't gotten a chance yet. For now though I just wanted to point out that it seems like your replies were meant to have images in them (implied by the text and large open whitespace), but they don't show up for me.

Another thing that randomly occurred to me is permissions. It's a bit of a long shot but are you possibly running fb2k as admin? That would probably cause any files/folders it creates to be owned by the admin user rather than you user, which then might not have permission to delete them. You can check this by right-clicking on the folder -> Properties -> Security -> Advanced and seeing who is listed as the owner (at the top of the resulting dialog) as well as the permissions for other users below, and compare that to the user you're running as when you're trying to delete the file.

— Reply to this email directly, view it on GitHub https://github.com/jacquesh/foo_openlyrics/issues/273#issuecomment-1596165612 , or unsubscribe https://github.com/notifications/unsubscribe-auth/BAUDGQOGOBWKYYKDMIB4DDTXL4E2HANCNFSM6AAAAAAZJVAZ2E . You are receiving this because you were mentioned. https://github.com/notifications/beacon/BAUDGQJE32EKRMAZ4UZC5GDXL4E2HA5CNFSM6AAAAAAZJVAZ2GWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTS7EOG6Y.gif Message ID: @.***>

-- This email has been checked for viruses by Avast antivirus software. www.avast.com

purdym commented 1 year ago

Solution, if any one else need this:

Carefully note and

Delete deepest directory first. ``` rmdir "Patti Smith - Land- Horses \/\ Land of a Thousand Dances \/" rmdir "Patti Smith - Land- Horses \/" ``` ![error 10](https://github.com/jacquesh/foo_openlyrics/assets/136852289/1365bc1d-527d-44c3-8a26-cdca555b511d)
ollyjarvis commented 12 months ago

Adding to this, artists with names starting with and/or ending with a period '.' create folders that exhibit the same problems as folders with a '/' in the name