Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor DownloadStub hash calculation and rename DownloadItemType.song to track #1097

Draft
wants to merge 2 commits into
base: redesign
Choose a base branch
from

Conversation

Maxr1998
Copy link
Collaborator

@Maxr1998 Maxr1998 commented Mar 8, 2025

Haven't yet verified my claim that this doesn't break anything, so draft for now. Should be rebase-merged to keep the history later on.

@Maxr1998 Maxr1998 requested a review from Chaphasilor March 8, 2025 22:28
Comment on lines +1320 to +1331
track("song", true, true),
image("image", true, true),
anchor("anchor", false, false),
finampCollection("finampCollection", false, false);

const DownloadItemType(this.requiresItem, this.hasFiles);
const DownloadItemType(this.isarType, this.requiresItem, this.hasFiles);

///!!! Used by `DownloadStub.getHash` to calculate the isarId for
///!!! the downloads system, DO NOT EDIT for any existing entries.
///!!! Doing so would invalidate existing downloads
///!!! and cause them to be deleted and re-downloaded.
final String isarType;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this (and the updated hash calculation) is the juicy bit, right? That looks like it would solve the issue on an API issue at least 👍🏻

And theoretically we could add a proper migration later on, that updates hashes based on the new calculation method or something, but that might be unnecessary.
Using hard-coded strings instead of enum names seems like a good idea anyway, considering that other enum options might be renamed later on as well.

Copy link
Collaborator Author

@Maxr1998 Maxr1998 Mar 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes & yes. The only thing missing for this PR is doing some testing, which I couldn't do last weekend, but I'll hopefully have the time to do that later this week.
Oh, and I need to rebase and fix the merge conflicts.

A migration would definitely be possible, but I'll leave that to someone more knowledgeable with isar 😅

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. Let me know if you want me to test things as well.

And why do you want to rebase-merge? What's the benefit? I've only ever used the two other options...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants