Conversation
Deploying asbplayer with
|
| Latest commit: |
657ea9f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://bb82afb2.asbplayer.pages.dev |
| Branch Preview URL: | https://fix-prefix-file-names.asbplayer.pages.dev |
| name = sanitize(name, { replacement: replacement }); | ||
| // Prefix to allow filtering by asbplayer created files, | ||
| // and to prevent Anki from skipping cleanup of files that start with an underscore. | ||
| return 'asbp_' + name; |
There was a problem hiding this comment.
Only reservation with this change, is that IIRC there was a file length limit on Android that caused me to make the file names really short, like <= 32 characters. With this change it might be possible to go over that limit. One way to work around this would be to add the asbp_ prefix in makeFileName in audio-clip.ts and image.ts instead.
There was a problem hiding this comment.
Or maybe reducing maxPrefixLEngth in those files by 5
There was a problem hiding this comment.
Does the problem on Android have to do with creating cards on Android? Or just viewing them on AnkiDroid? Seems like viewing is fine for me, but I've never tried making them on Android. Either way I think we would already have an issue if 32 was the limit since you have the prefix (24) plus the timestamp + random string (18)
There was a problem hiding this comment.
Actually I just tried loading it into Firefox Nightly on Android using web-ext (such a pain to setup) with Ankiconnect Android, and the audio file seems fine too (img still doesn't get captured on Android FF). Though there's a random number at the end instead of the random string. Does Ankiconnect create that and is that related to the issue?
There was a problem hiding this comment.
Does the problem on Android have to do with creating cards on Android? Or just viewing them on AnkiDroid?
It was the former
Either way I think we would already have an issue if 32 was the limit since you have the prefix (24) plus the timestamp + random string (18)
Yeah tbh I don't remember what the actual limit was. It's possible I chose a very small number just to be very safe.
There was a problem hiding this comment.
Though there's a random number at the end instead of the random string. Does Ankiconnect create that and is that related to the issue?
Hmm yeah must be AnkiConnect by process of elimination. I suppose that would increase the filename length but if it's working for you I guess we're fine. A limit in the 40s feels extraordinarily small for an OS.
There was a problem hiding this comment.
From Googling, the smallest number I could fine was 50. Does the filename you observed in AniiConnect less than 50?
There was a problem hiding this comment.
With the new prefix I'm getting in total between like 56-58 (excluding file ext) depending on the length of the timestamp. The number at the end (idk if it's a random num or what) is around 20 by itself. I searched around as well and heard that the limit can be between 63-255 depending on encoding but who knows. Maybe it was less on older Android versions too. Either way I'll leave it up to you
There was a problem hiding this comment.
Sounds like we were already above 50 so the limit being more like 63 seems more plausible. Let's just yolo it and we can always lower it back down if it's a problem.
closes #917