thebigg73 / OpenSongTablet

Android port of OpenSong. Use your mobile device as a portable song book. Gareth Evans
GNU General Public License v3.0
32 stars 23 forks source link

v6 Custom pads - valid filename but not found #260

Closed iv-gha closed 3 months ago

iv-gha commented 6 months ago

Hello Gareth,

Support for Custom (Auto) pads needs adjustment.

The expectation is that pad files are in the pads folder with the setting for a key only needing the terminal filename. This does not work for v6 - files are not found. Pad folder path is not being added when tested/loaded in code? When selected, a file in pads folder not stored only as terminal filename?

Cheers Ian

thebigg73 commented 5 months ago

Hi Ian,

Really good to hear from you!

When adding a link to a file in the OpenSong folder, the app shoud add ../OpenSong/ as a file identifier prefix. Pad files do not need to be placed here, but it is recommended. The app automatically has permissions for this folder, but using the file select method it also can get permission for files selected from elsewhere on the device storage. When loading a pad file the known prefix for a local file is identified, removed and a localised uri is generated. If not, the full file location in the custom pad location is used as the uri.

This is working as expected on my device (pad plays fine) as set on the screenshot attached. Is this displaying/behaving differently on your device?

autopad

iv-gha commented 5 months ago

This is compatibility. v5 stores and displays terminal filename - I think it was excellent to avoid ../ technical paths for files in the default pad folder - user friendly. On move v5 to v6 custom pads in the default folder stored as terminal filename will fail. So can a valid v5 setting be a valid v6 setting.

thebigg73 commented 5 months ago

Simple fix Keep localised files (with ../OpenSong/Pads) for v6. If v5 custom pads are detected, add this prefix. Regardless, don't show this prefix to the user. Purely used to make getting the actual uri easier in the background.

https://github.com/thebigg73/OpenSongTablet/commit/24d2bd26d9d7c6c766d78d9551193b7925543cc7