• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FixBrokenFilePaths
#1
I already used "Fix Broken File Paths" several times successfully. Now I'm confused by a combination that doesn't work.
MSP version is 2.5.8, Android 4.4, MobileSheets Storage Location is /storage/emulated/0/_MobileSheets

Some songs were imported from _MobileSheets\Fkbk0\Django-in-June-compilation-book\Django-in-June-compilation-book.pdf

I renamed the folder and kept the name of the PDF file unchanged
_MobileSheets\Fkbk0\DjangoInJune_Compilation\Django-in-June-compilation-book.pdf
as expected the respective songs were reported as missing
   

I tried to correct that using "Fix Broken File Paths" and selected the new folder via MSPs file manager
   
and inserted the previous folder via copy/paste from the files tab of the song editor
   

I wonder why replacing the folder doesn't work, it reports "Total number of updated paths: 0" and the files remain missing
   

CSV import from the new folder works successfully. Copying the PDF file into both folders fixes the "missing files" error.
Any idea what confuses the "Fix Broken File Paths" mechanism?

A backup of my library will be available soon in my GoogleDrive.
first language: German
Acer A1-830, Android 4.4.2 - HP x2 210 G2 Detachable, Win 10 22H2 - Huawei Media Pad T5, Android 8.0 - Boox Tab Ultra C, Android 11
www.moonlightcrisis.de - www.basdjo.de - www.frankenbaend.de


Reply
#2
I'm making some changes for this with the next update, so you may want to hold off. The bottom line is that due to all paths in the database being relative to the storage location by default, you have to figure out whether you are replacing an absolute path or relative path. The easiest way to figure this out is with a tool that can run a SQL query on the Files table. So if you remove the storage location from the first part of the path in your screenshot, then it should work.

Mike
Reply
#3
Thank you for the clarification. Now I understand what's going on.

I used copy/paste form the file tab to make sure that I use the correct path and avoid typos.
The path shown on the files tab is completed to an absolute path by adding the MSP folder path, but "Fix Broken File Paths" works with the exact database content. I could have noticed that: I selected an absolute path for "Replace with:" but the dialog displays it as a relative path, exactly as it will be stored in the database.
first language: German
Acer A1-830, Android 4.4.2 - HP x2 210 G2 Detachable, Win 10 22H2 - Huawei Media Pad T5, Android 8.0 - Boox Tab Ultra C, Android 11
www.moonlightcrisis.de - www.basdjo.de - www.frankenbaend.de


Reply
#4
Yeah, it's a little confusing, but the manual option is literally just invoking a query on the database to replace one string with another. So if the path is stored as a relative path, then you have to use relative paths on the dialog. If you have an absolute path that you need to replace with another absolute path, that should work on Android, but it will not be allowed on Windows 10 (as all paths must be under the storage location).

Mike
Reply
#5
Knowing now how things work, I'm able to handle that, both on Android and Win10. Thanks again Mike.
first language: German
Acer A1-830, Android 4.4.2 - HP x2 210 G2 Detachable, Win 10 22H2 - Huawei Media Pad T5, Android 8.0 - Boox Tab Ultra C, Android 11
www.moonlightcrisis.de - www.basdjo.de - www.frankenbaend.de


Reply
#6
If you add file paths (%FILE_PATHS%) to the list of searchable fields in the filter toolbar as I proposed here
https://zubersoft.com/mobilesheets/forum...304&page=2
a search for paths containing "storage" would find all non-relative paths.
I assume that this easy to implement and it stays nicely within the concept that already exists.
first language: German
Acer A1-830, Android 4.4.2 - HP x2 210 G2 Detachable, Win 10 22H2 - Huawei Media Pad T5, Android 8.0 - Boox Tab Ultra C, Android 11
www.moonlightcrisis.de - www.basdjo.de - www.frankenbaend.de


Reply
#7
Hello Mike,
did you already think about adding FILE_PATHS to the list of fields to be filtered?

That should be fully sufficient to find and handle non-relative paths, so all additional efforts could be skipped to fix the issue that I reported here:
https://zubersoft.com/mobilesheets/forum...p?tid=5304

And I recently came across another use case where filtering on file paths would be useful:
I regularly import songs from complete fakebooks. In those cases I use one "Albums" entry per fakebook. But in case a Bb- or Eb-Version of the fakebook is available, I use the same album name for all of them. That's my decision, I know, but I think that this is a good way to keep similar layouts of the same song in different keys closely together.
In that case the file path or file name is the only criteria to filter by C-, Bb- or Eb-Version.
first language: German
Acer A1-830, Android 4.4.2 - HP x2 210 G2 Detachable, Win 10 22H2 - Huawei Media Pad T5, Android 8.0 - Boox Tab Ultra C, Android 11
www.moonlightcrisis.de - www.basdjo.de - www.frankenbaend.de


Reply
#8
FYI, I use also the Key tab not only to indicate the key but for which instrument the sheet is.

So I have 

Bb-Instrument
Eb-Instrument
Bass-Instrument

(not using C-Instrument, since that's the standard for me)

It's useful that all the tabs can be used for additional entries like this even if it's not "tab-specific".

Maybe that's a trick you like to use as well.
Reply
#9
I'll see what I can do for the next update.

Mike
Reply
#10
@Mike: That would be great, thanks
@Brix: Thank you for the tip. I know about the possibility of editing the groups e.g. I have completely replaced "Source Types" with my personal list. But I had not thought of adding the instrument information to the Keys group. In fact that's the perfect place to do that.
Doing that for already imported songs is another example where filtering by file name would be helpful.
first language: German
Acer A1-830, Android 4.4.2 - HP x2 210 G2 Detachable, Win 10 22H2 - Huawei Media Pad T5, Android 8.0 - Boox Tab Ultra C, Android 11
www.moonlightcrisis.de - www.basdjo.de - www.frankenbaend.de


Reply
#11
I've added "File Paths" to the search dropdown so that you can filter on just that and then enter a file path. Hopefully this will work for what you need.

Mike
Reply
#12
Many thanks. I'll give it a try, I'm pretty sure it will do what I need.
first language: German
Acer A1-830, Android 4.4.2 - HP x2 210 G2 Detachable, Win 10 22H2 - Huawei Media Pad T5, Android 8.0 - Boox Tab Ultra C, Android 11
www.moonlightcrisis.de - www.basdjo.de - www.frankenbaend.de


Reply




Users browsing this thread:
2 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2024 MyBB Group.