rasmuslos / AmpFin

Native Jellyfin music player for iOS & iPadOS
Other
107 stars 10 forks source link

Save item type V3 #43

Closed gnattu closed 1 month ago

gnattu commented 1 month ago

This uses another modelContainer attached directly to the download manager. This avoids data migration and works with current data, which is good enough until we find a better data structure and/or Apple fixes their migration bug.

Replaces #31

rasmuslos commented 1 month ago

I am hoping that the goblin at apple who implemented SwiftData is having a bad day because I am getting some weird, obscure errors when running my migration. But I am confident that I will be able to solve soon, so I am pretty sure that we can use the new models for this. I added an enum to the track model with the filetypes in the PR, so we don't have to run another migration for this.

rasmuslos commented 1 month ago

So it seems like SwiftData cannot cope with two models with the same name, even though they are in different containers. But the migration is working now.

gnattu commented 1 month ago

I added an enum to the track model with the filetypes in the PR, so we don't have to run another migration for this.

Would adding new file type to the enum require extra migration? If it is the case then we can just use string i guess

rasmuslos commented 1 month ago

The enum's raw value is a string so it makes no difference to the database. Adding new values doesn't require a migration.

rasmuslos commented 1 month ago

Do you have an ETA for this? I really want to release the next version. It's no problem if it takes longer, I can create a new release for this PR.

gnattu commented 1 month ago

It should due this weekend. I'm busy at bugfix for the Jellyfin server currently. Sorry for that.

gnattu commented 1 month ago

Closed in favor of #47