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

Improve image retrieve to optimize memory comsumption #47

Merged
merged 1 commit into from
Jan 6, 2024

Conversation

thomas-ernest
Copy link
Owner

Add parameters to arteitem._get_image_url in order to enable image resolution and text layer. Use 1920x1080 resolution and no text to populate fanart, use 320x180 resolution and text for thumbnails.

More details in discussion of issue #44 .

@thomas-ernest thomas-ernest changed the title 44 improve image retrie to optimize mem comsumption Improve image retrieve to optimize memory comsumption Jan 4, 2024
@hypnotoad
Copy link

hypnotoad commented Jan 5, 2024

The memory consumption definitely wen down a lot (at least 100MB on usual list pages). But I there is only a thumbnail placeholder now and no preview icon on the left (just the full hd image in the background). I think downloading the small resolution does not work. In the console, I see:

GetImageHash - unable to stat url https://api-cdn.arte.tv/img/v2/image/qteyKntxDG2BaxEaXf6kdZ/320x180?type=TEXT
GetImageHash - unable to stat url https://api-cdn.arte.tv/img/v2/image/qteyKntxDG2BaxEaXf6kdZ/320x180?type=TEXT
CurlFile::Open - <https://api-cdn.arte.tv/img/v2/image/qteyKntxDG2BaxEaXf6kdZ/1920x1080>
Caching image 'https://api-cdn.arte.tv/img/v2/image/qteyKntxDG2BaxEaXf6kdZ/1920x1080' to '5/5dc96423.jpg':
cached image 'special://masterprofile/Thumbnails/5/5dc96423.jpg' size 1920x1080
GetImageHash - unable to stat url https://api-cdn.arte.tv/img/v2/image/qteyKntxDG2BaxEaXf6kdZ/320x180?type=TEXT

PS: I use Kodi 20.1 from Debian 12.

@thomas-ernest
Copy link
Owner Author

When I did my test I used 480x270, not 320x180 actually. I will update the PR accordingly. It is 4 times smaller instead of 6.

@thomas-ernest thomas-ernest force-pushed the feature/44_optimize_thumbnail_size branch from 3ace087 to 5b16a5d Compare January 5, 2024 20:00
@hypnotoad
Copy link

Works for me. For the reference how I checked memory consumption:

cd /sys/fs/cgroup
mkdir mem
cd mem
echo 170000000 > memory.max
echo 0 > memory.swap.max
# start kodi
pgrep kodi.bin > cgroup.procs 
while true; do cat memory.current; sleep 0.1; done

Thank you!

@thomas-ernest thomas-ernest merged commit 23d113e into master Jan 6, 2024
3 checks passed
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