• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ABC files and storage settings V3.9.3
#1
Are ABC files supposed to follow the same import rules as PDFs?

I.E. if you have "Let Mobile Sheets Manage My Storage" turned OFF should the import of ABC files ignore this setting? 

My test environment consists of a directory called "Test" that lives under the default "Files" directory, and a library called "Test" that contains a collection called "Test Collection".  I use this for testing things like csv imports etc..

So, I was just playing around trying to learn more about ABC files, how they are formatted and investigating whether MS can transpose them (which I haven't figured out yet).

Anyhow, I would copy an ABC file to the storage location I wanted it in, do an import and check that all was fine, delete the song, including associated files, edit my source and copy it back over for a new import, check it out... rinse and repeat.  One time I forgot the deletion and got an alert about overwriting the file - HUH?  It should be using the file I'd just copied over AFAIK.  

So I looked around and lo and behold there's a new directory with the songs name on it.  Deleted the song taking care to tell it to delete the file and voila, the directory is now gone.

I thought this was odd, so I looked further and discovered that the option, although greyed out, to create directories for songs was checked, so I enabled MS file management which enabled the check box, remove the check, and disabled management again.  Tried a new import and now the file is going into the Files directory where everything else is.  Deleted song and file, reverted everything to a greyed check box and it went back to creating directories even though I reckon it shouldn't be as I've disabled MS storage management.

Tested a PDF and it still works as expected with no directories or copies being created.  I haven't investigated Chordpro stuff yet so I don't know what it's doing, and I've got very little idea of how to use ABC yet too.  It's all a big learning curve at the moment.

Oh yeah, is there a way to transpose ABC displayed songs within MS?

Thanks
You're only paranoid if you're wrong  Cool
I'm using an Onyx Boox Tab X, and play low brass: mainly 'Bone and Tuba
Reply
#2
Yes, the same code is used for processing imported files regardless of their file type (at least in terms of handling the copying of files). So .abc files are handled in the same way as a .pdf file. I can't really speak to what you were seeing, as I don't have every piece of information I would need to draw a conclusion. The only time MobileSheets will force a copy of a file is if it resides in a "cache" folder (which can happen when importing files through other apps).

You said you imported from the "Files" directory. I don't know which directory you are referring to. Do you mean /storage/emulated/0/Android/data/com.zubersoft.mobilesheetspro/files, or some other folder named Files? 

As far as transposing ABC, this was discussed in this forum post: https://www.zubersoft.com/mobilesheets/f...l#pid51491

You have to use %%transpose 1, for example. I haven't decided yet how I want to handle transposing of abc files in MobileSheets, as I don't currently have a place in the database to store the transposition information, and I don't want to have to allocate all the same data as I would for a text/chord pro file just for the one or two fields I would need. I may set up a new table for this when I'm making other database changes so I can support transposing ABC files in MobileSheets itself (which will probably just dynamically insert the transpose statement into the ABC file contents).

Mike
Reply
#3
actually, no, they Do NOT follow the same rules.

i did this on a Boox 10.3:

- do not let msp manage my files
- create a minimum db consisting of an abc and a pdf residing in the same directory (not 100% sure, might have been in disjoint places under the same root). I believe I imported the pdf via bookmarks.
- clear the library

afterwards, the pdf is gone, but the abc is still there.
Reply
#4
(10-19-2024, 03:31 AM)Zubersoft Wrote: Yes, the same code is used for processing imported files regardless of their file type (at least in terms of handling the copying of files). So .abc files are handled in the same way as a .pdf file. I can't really speak to what you were seeing, as I don't have every piece of information I would need to draw a conclusion. The only time MobileSheets will force a copy of a file is if it resides in a "cache" folder (which can happen when importing files through other apps).

You said you imported from the "Files" directory. I don't know which directory you are referring to. Do you mean /storage/emulated/0/Android/data/com.zubersoft.mobilesheetspro/files, or some other folder named Files? 

As far as transposing ABC, this was discussed in this forum post: https://www.zubersoft.com/mobilesheets/f...l#pid51491

You have to use %%transpose 1, for example. I haven't decided yet how I want to handle transposing of abc files in MobileSheets, as I don't currently have a place in the database to store the transposition information, and I don't want to have to allocate all the same data as I would for a text/chord pro file just for the one or two fields I would need. I may set up a new table for this when I'm making other database changes so I can support transposing ABC files in MobileSheets itself (which will probably just dynamically insert the transpose statement into the ABC file contents).

Mike

Hi Mike,
sorry, it was getting late...
Yes, the "Files" directory is the one you mentioned:
/storage/emulated/0/Android/data/com.zubersoft.mobilesheetspro/files 

Actually, Windows reports this location as:
This PC\Tab X\Internal shared storage\Android\data\com.zubersoft.mobilesheetspro\files
but I am assuming that the /storage/emulated/0 part is being hidden but for clarity I'll use it instead of the This PC\Tab X\Internal shared storage\  section for this description.
The file explorer in My Boox TabX reports the folder as:
/storage/Android/data/com.zubersoft.mobilesheetspro/files  - Note the missing: emulated/0/

The "Test" directory is:
/storage/emulated/0/Android/data/com.zubersoft.mobilesheetspro/files/Test 

The library is also called "Test" with a database named "test.db" in the  /storage/emulated/0/Android/data/com.zubersoft.mobilesheetspro/files directory

The /storage/emulated/0/Android/data/com.zubersoft.mobilesheetspro/files/Test directory contains several files which were copied there using Windows file explorer - the same way I copy over PDFs -  but we'll use Test.abc as an example.
  1. Starting conditions: The Test library is empty except for a collection called "Test collection"
  2. In Settings | Storage "Let Mobile Sheets Manage My Files" is UNchecked however "Create Subdirectories For Songs", while greyed out, is checked.*
  3. Import "Test.abc" from  /storage/emulated/0/Android/data/com.zubersoft.mobilesheetspro/files/Test into the collection
  4. Duplicate file behaviour is set to "Ignore Duplicate Files"
  5. New song appears in the library associated with "Test collection".
  6. I now have a directory called:  /storage/emulated/0/Android/data/com.zubersoft.mobilesheetspro/files/Test that contains a copy of "Test.abc"
  7. When I delete the song  /storage/emulated/0/Android/data/com.zubersoft.mobilesheetspro/files/Test disappears as one would expect.

If I repeat the above with Storage settings manipulated to remove the greyed out check in "Create Subdirectories For Songs" then "Test.abc" is copied into  /storage/emulated/0/Android/data/com.zubersoft.mobilesheetspro/files/ 

This is not how PDF imports behave.  To be certain, I checked a PDF import in case V3.9.3 had an accidental change to the behaviour I am used to.

I will investigate the transposition stuff shortly - I'm still playing really as I've never used ABC files before.


* These are my default settings and behave correctly for PDFs
You're only paranoid if you're wrong  Cool
I'm using an Onyx Boox Tab X, and play low brass: mainly 'Bone and Tuba
Reply
#5
RAc - That's actually somewhat of a bug. MobileSheets should not delete files if Settings->Storage->Let MobileSheets Manage my Files is unchecked, so I will fix that.

Lawrie - This is happening because of some of the processing that has to be done with abc files, because I currently can't just use them as is. If the file is encoded with something other than UTF-8 (or the character set detection returns something other than UTF-8), or it has a BOM, then I have to copy the file into the cache dir and import it from there, causing it to be imported into the storage location instead of being used from its original location. I'm going to modify the code to also allow ISO-8859-1 because I think the detector sometimes incorrectly returns that encoding when the file is actually UTF-8, because if there are no unicode characters, then either encoding would effectively be the same. So this change may resolve this issue for you with the next update.

Mike
Reply
#6
Thanks Mike.
You're only paranoid if you're wrong  Cool
I'm using an Onyx Boox Tab X, and play low brass: mainly 'Bone and Tuba
Reply




Users browsing this thread:
8 Guest(s)


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