AppleTV files emptied
Turned off my AppleTV for the evening & found that after turning it back on & opening RetroArch, my downloads folder was completely empty as if the app has cleared itself
Yeah, that's just part of what tvOS does, unfortunately.
Thanks for the response. Also spoke to someone about it on Discord. Shitty limitation we have on the AppleTV, I suppose I'll just stick to my Batocera PC setup for now until I can get it to run properly on the MacBook.
Dear Team, firstly, thank you so much for this work. It's awesome.
Off the back of this, I've created script to backup and even two-way sync file. Hopefully helpful to some: https://github.com/blaz0r/AppleTV-RetroArch-Sync
Another idea is cloud kit. This would be my vote for a “sanctioned” way to solve this problem
https://developer.apple.com/library/archive/documentation/General/Conceptual/AppleTV_PG/iCloudStorage.html
I have been poking around at exactly how to solve this problem for a long time, and CloudKit runs into the same three problems that all network access does:
- Can't always download just one file
- Can't use standard Unix paths/C file system calls
- Can't sync everything
(There's actually a fourth problem that CloudKit would avoid, which is "don't accidentally become a piracy tool". It's why loading content files directly over HTTP or adding URLs to playlists is nearly a non-starter.)
- Can't always download just one file
One example would be disc images in bin/cue format, and downloading just one of them doesn't work; all of the relevant files need to be downloaded. For some cores like DOSBox, it's really hard to know which files are going to be needed ahead of time, without just running the core. Which brings us to....
- Can't use standard Unix paths/C file system calls
In order to access the files on iCloud, the CloudKit APIs must be used. However, not every core uses the libretro vfs that the frontend provides; there are some that when they are compiled for Apple devices will assume that means they can use standard file system calls, and for the most part they're right, until the files start being served over CloudKit.
So if we might need any and all of the files and we can't know which files we'll need, we could just download all the files?
- Can't sync everything
Although there are probably many users whose libraries are small enough that this isn't a concern, it doesn't take much to make this a worrying proposition. Each of my PS1 chd files is about 300MB. Downloading gigs of data every time the OS decides to delete it is not a polite thing to do.
There's actually a fourth problem on tvOS, which is that CloudKit does not have access to iCloud Drive; it only has access to the application storage area, which is not really a file system in the traditional sense. This isn't typically a problem for small files or relatively small amounts of data, but it's not really designed to be used as a store for huge amounts of data in large files. It's something that could perhaps reasonably be tuned if the other issues didn't make it so challenging.
I appreciate all the effort you put in this.
Was fun to be able to try it off the AppleTV for the time, though!
Thank you!