avery42/delfin
9
146
Fork
You've already forked delfin
28

Implement image cache on disk #142

Open
selfhoster1312 wants to merge 1 commit from selfhoster1312/delfin:image-cache into main
pull from: selfhoster1312/delfin:image-cache
merge into: avery42:main
avery42:main
avery42:weblate-delfin-shared
avery42:quick-connect-check-enabled
avery42:132-deinterlacing
avery42:gst
avery42:windows
Contributor
Copy link

This is an initial implementation for #13

TODO:

  • refresh cache some time ?
  • add documentation
  • find ergonomic ApiClient::get_(..)/get_(..)_url scheme
  • remove last reqwest::get usage
  • (削除) figure out if ImageCache builder should use std::fs:, tokio::fs, glib stuff? (削除ここまで)

Shit is fast now 😎

This is an initial implementation for #13 TODO: - [x] refresh cache some time ? - [x] add documentation - [x] find ergonomic ApiClient::get_(..)/get_(..)_url scheme - [x] remove last reqwest::get usage - ~~figure out if ImageCache builder should use std::fs:, tokio::fs, glib stuff?~~ Shit is fast now 😎
selfhoster1312 force-pushed image-cache from 11fad6c301
Some checks failed
ci/woodpecker/pr/release Pipeline was successful
ci/woodpecker/pr/lint Pipeline failed
ci/woodpecker/pr/test Pipeline was successful
to 90d072b1e2
Some checks failed
ci/woodpecker/pr/release Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/lint Pipeline failed
2024年08月20日 00:55:49 +02:00
Compare
selfhoster1312 force-pushed image-cache from 90d072b1e2
Some checks failed
ci/woodpecker/pr/release Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/lint Pipeline failed
to c307e8465b
Some checks failed
ci/woodpecker/pr/release Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/lint Pipeline failed
2024年08月20日 11:00:39 +02:00
Compare
selfhoster1312 force-pushed image-cache from c307e8465b
Some checks failed
ci/woodpecker/pr/release Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/lint Pipeline failed
to 68af6a1c3e
All checks were successful
ci/woodpecker/pr/release Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
2024年08月20日 12:11:58 +02:00
Compare
selfhoster1312 force-pushed image-cache from 68af6a1c3e
All checks were successful
ci/woodpecker/pr/release Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
to 7a3c78fdf3
Some checks failed
ci/woodpecker/pr/release Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/lint Pipeline failed
2024年08月20日 20:43:33 +02:00
Compare
selfhoster1312 force-pushed image-cache from 7a3c78fdf3
Some checks failed
ci/woodpecker/pr/release Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/lint Pipeline failed
to b79736dbd4
All checks were successful
ci/woodpecker/pr/release Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
2024年08月20日 21:43:40 +02:00
Compare
selfhoster1312 force-pushed image-cache from b79736dbd4
All checks were successful
ci/woodpecker/pr/release Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
to 9d8f713a8c
Some checks failed
ci/woodpecker/pr/release Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/lint Pipeline failed
2024年08月22日 12:20:06 +02:00
Compare
Author
Contributor
Copy link

So after talking with Jellyfin devs in #jellyfin-dev on libera.chat, it appears that the item returned from the API knows whether there is an image or not via the "image tags". That will allow us to:

  • avoid querying a missing image (404)
  • refresh the cache when needed because the image tag changed
So after talking with Jellyfin devs in #jellyfin-dev on libera.chat, it appears that the item returned from the API knows whether there is an image or not via the "image tags". That will allow us to: - avoid querying a missing image (404) - refresh the cache when needed because the image tag changed
selfhoster1312 force-pushed image-cache from 9d8f713a8c
Some checks failed
ci/woodpecker/pr/release Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/lint Pipeline failed
to 94ad89fa63
All checks were successful
ci/woodpecker/pr/release Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
2024年08月22日 16:42:44 +02:00
Compare
Author
Contributor
Copy link

So i went with this for the moment, where we query an image using an ImageId (generated from BaseItemDto in API response) and some ImageParams. The id in the ImageId doesn't have to be that of the original item, because it can be a parent item's ID in some cases.

If we ever realize that the Jellyfin API does funky things we may want to add an orig_id in the ImageId struct to keep track of what API response produced an invalid entry, but for the moment it should do the trick.

I still should rewrite EpisodeThumbnail and NextUp who still call reqwest manually, and it should be ready for review. I'll also try to make the jellyfin_api::cache module smaller and more tidy... it grew somewhat unexpectedly in size over the past days.

So i went with this for the moment, where we query an image using an `ImageId` (generated from `BaseItemDto` in API response) and some `ImageParams`. The id in the `ImageId` doesn't have to be that of the original item, because it can be a parent item's ID in some cases. If we ever realize that the Jellyfin API does funky things we may want to add an `orig_id` in the `ImageId` struct to keep track of what API response produced an invalid entry, but for the moment it should do the trick. I still should rewrite `EpisodeThumbnail` and `NextUp` who still call reqwest manually, and it should be ready for review. I'll also try to make the `jellyfin_api::cache` module smaller and more tidy... it grew somewhat unexpectedly in size over the past days.
selfhoster1312 force-pushed image-cache from 94ad89fa63
All checks were successful
ci/woodpecker/pr/release Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
to b13c98011b
All checks were successful
ci/woodpecker/pr/release Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
2024年08月22日 17:24:19 +02:00
Compare
selfhoster1312 force-pushed image-cache from b13c98011b
All checks were successful
ci/woodpecker/pr/release Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
to c9ce0449f2
Some checks failed
ci/woodpecker/pr/release Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/lint Pipeline failed
2024年08月22日 18:16:30 +02:00
Compare
selfhoster1312 changed title from (削除) WIP: Implement image cache on disk (削除ここまで) to Implement image cache on disk 2024年08月22日 18:16:43 +02:00
Author
Contributor
Copy link

Ready for review 👍

Ready for review 👍
selfhoster1312 force-pushed image-cache from c9ce0449f2
Some checks failed
ci/woodpecker/pr/release Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/lint Pipeline failed
to 015e910b6f
All checks were successful
ci/woodpecker/pr/release Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
2024年08月22日 20:03:20 +02:00
Compare
First-time contributor
Copy link

@avery42 @selfhoster1312 Is there a chance this will get worked on / merged? I have the media on a NAS with rather high latency, so while navigating my Jellyfin instance, waiting for the images to load (bundled with the 24 items per page and missing sorting feature) is the slowest part of my whole experience. This would solve that.

@avery42 @selfhoster1312 Is there a chance this will get worked on / merged? I have the media on a NAS with rather high latency, so while navigating my Jellyfin instance, waiting for the images to load (bundled with the 24 items per page and missing sorting feature) is the slowest part of my whole experience. This would solve that.

@M3t0r @selfhoster1312 Sorry for the delay, unfortunately I haven't had much time to work on this lately. I plan on reviewing this soon, it should be in the next release.

@M3t0r @selfhoster1312 Sorry for the delay, unfortunately I haven't had much time to work on this lately. I plan on reviewing this soon, it should be in the next release.
First-time contributor
Copy link

There's a strange behaviour with episode images vs the main branch. Is this expected?

There's a strange behaviour with episode images vs the main branch. Is this expected?
All checks were successful
ci/woodpecker/pr/release Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
Required
Details
ci/woodpecker/pr/lint Pipeline was successful
Required
Details
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u image-cache:selfhoster1312-image-cache
git switch selfhoster1312-image-cache
Sign in to join this conversation.
No reviewers
Labels
Clear labels
Kind/Breaking
Breaking change that won't be backward compatible
Kind/Bug
Something is not working
Kind/Documentation
Documentation changes
Kind/Enhancement
Improve existing functionality
Kind/Feature
New functionality
Kind/Security
This is security issue
Kind/Testing
Issue or pull request related to testing
Needs Design
Packaging/AUR
Issue with the AUR package
Packaging/Flatpak
Issue with the Flatpak
Priority
Critical
The priority is critical
Priority
High
The priority is high
Priority
Low
The priority is low
Priority
Medium
The priority is medium
Reviewed
Confirmed
Issue has been confirmed
Reviewed
Duplicate
This issue or pull request already exists
Reviewed
Invalid
Invalid issue
Reviewed
Upstream
Issue with a package or library we use that can't be fixed independently
Reviewed
Won't Fix
This issue won't be fixed
Status
Abandoned
Somebody has started to work on this but abandoned work
Status
Blocked
Something is blocking this issue or pull request
Status
Need More Info
Feedback is required to reproduce issue or to continue work
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
avery42/delfin!142
Reference in a new issue
avery42/delfin
No description provided.
Delete branch "selfhoster1312/delfin:image-cache"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?