syd711 / vpin-studio

Competition, table, and player management for VPins.
MIT License
33 stars 2 forks source link

[Bug] Wheels image thumb images are not deleted when deleting a wheel image #541

Closed dmccombs closed 1 week ago

dmccombs commented 1 month ago

Describe the bug When deleting a wheel image via the Asset Manager, the main image is removed in the appropriate POPMedia sub directory on the cabinet, but the corresponding pthumbs\ sub directory images are not. This causes a strange issue with wheel images for playlists, where trying to replace a image causes the original image to be restored.

To Reproduce Steps to reproduce the behavior:

  1. Open Asset Manager in VPin-Studio
  2. Select a table or playlist with an existing wheel image
  3. Note the filename of the image existing on the cabinet in the corresponding PinUPSystem\POPMedia\ directory as well as <filename>_thumb.png and <filename>_thumb_sm.png in the pthumbs\ sub directory.
  4. Delete the wheel image via Asset Manager
  5. Note that while the main image file is removed, the pthumbs\ files are not
  6. If this is a playlist, try uploading a new wheel image in its place, then open PinUp Popper and see that is it showing the old image on the wheel bar.

Expected behavior All files for a given wheel image, including pthumbs\<filename>_thumb.png and pthumbs\<filename>_thumb_sm.png should be removed when deleting the wheel image in Asset Manager.

Desktop (please complete the following information):

syd711 commented 1 month ago

Fixed with 3.8

dmccombs commented 1 month ago

@syd711 I'm still seeing this problem on 3.8.1.

For example, if I have a playlist named "Classic", I delete the wheel image via the asset manager in vpin studio with the cabinet in maintenance mode. The file named pl_Classic.png gets deleted from PinUPSystem\POPMedia\Default\Wheel\, but PinUPSystem\POPMedia\Default\Wheel\pthumbs\pl_Classic_thumb.png and PinUPSystem\POPMedia\Default\Wheel\pthumbs\pl_Classic_thumb_sm.png still exist on the cabinet and are shown as the wheel image in Popper.

Also, uploading a new image doesn't replace those thumb images, so the old wheel image continues to be shown until they're manually deleted.

syd711 commented 1 month ago

I have missed to check the playlists too. I've reopened the ticket

syd711 commented 3 weeks ago

I've fixed the deletion there. Altough I've found the pthumbs folder also in my Default folder, I haven't figured out yet when these icons are converted.

dmccombs commented 3 weeks ago

Interesting. At least on my cabinet, I don't have any phumbs folder in Default itself. Deleting the images in Default\Wheel\pthumbs\ is what I've had to do manually to get new images to show up in the frontend.

syd711 commented 2 weeks ago

I hope this is fixed now and will close this ticket.

Fixed with 3.9.2

dmccombs commented 2 weeks ago

This doesn't seem to be fixed for playlists on 3.9.3.

For instance, to test I put my cabinet into maintenance mode and open vpin studio's asset manager, then switch to playlists and then select my "Classic" playlist.

Then, I check what files exist (I have my pinball cabinet mounted on my local machine):

> pwd
/media/pinball/PinUPSystem/POPMedia/Default/Wheel
> ls pl_Classic.png
pl_Classic.png
> ls pthumbs/pl_Classic_thumb*
pthumbs/pl_Classic_thumb.png  pthumbs/pl_Classic_thumb_sm.png

Next, I delete the playlist's wheel image via the vpin studio asset manager. Now, the main wheel image file is gone, but the pthumbs still exist:

> pwd
/media/pinball/PinUPSystem/POPMedia/Default/Wheel
> ls pl_Classic.png
ls: cannot access 'pl_Classic.png': No such file or directory
> ls pthumbs/pl_Classic_thumb*
pthumbs/pl_Classic_thumb.png  pthumbs/pl_Classic_thumb_sm.png

At this point if I bring the cabinet out of maintenance mode, the deleted wheel image is still shown for the playlist. If I put it back in maintenance mode and upload a new different wheel image for that playlist, the main wheel image file is created, but since the pthumb files already exist they aren't regenerated and Pinup Popper still shows the old wheel image. At this point if I go back into maintenance mode and delete the files in pthumbs/, the files get regenerated off the current images when I it comes out of maintenance mode and the current images are displayed as expected.

Testing out via Pinup Popper's config tool, when deleting or replacing a playlist wheel image, the corresponding pthumbs/ files are removed and get regenerated on next run of the frontend.

syd711 commented 2 weeks ago

Ok, thanks for reporting back. Would have been to easy. I'll check more thoroughly this time.

syd711 commented 1 week ago

Ok, finally got it. Fixed with 3.10.1

dmccombs commented 5 days ago

Confirmed, works as expected now. Thanks @syd711!