teddycloud icon indicating copy to clipboard operation
teddycloud copied to clipboard

Custom Tonies caching issue

Open etofi opened this issue 11 months ago • 6 comments

I have integrated my music sharing from the NAS directly into the Docke container. -v /volume1/music:/teddycloud/data/www/custom_img:ro

Then I made the following entry in tonies.custom.json.

[
{  
  "model": "Eigene - Adya - Classic",
  "title": "Adya - Classic",
  "series": "Adya", 
  "episodes": "Classic",
  "pic": "/custom_img/Alben, Sampler & Singles/Alben & Singles/Adya/Classic/Cover.jpg"
}
]

That works perfectly. grafik

However, as soon as I activate the "Cache images" this no longer works and the following error appears in the log.

INFO |toniesJson.c:0280:tonies_readJson| Trying to read /teddycloud/config/tonies.custom.json with size 151
INFO |web.c:0152:web_download| Downloading file from '/custom_img/Alben, Sampler & Singles/Alben & Singles/Adya/Classic/Cover.jpg' into local file '/teddycloud/data/cache/B8BEF05ADEBABFE03B9C56E88C08E4DC19D9DD9BED3AF1B2E847CFDBFF5014B3.jpg'
ERROR|web.c:0040:web_parse_url| Unknown protocol
ERROR|web.c:0162:web_download| Failed to parse URL

etofi avatar Jan 02 '25 13:01 etofi

The cache function does not know where to download your image, as the Host URL is not set in the settings and you are using an absolute path without a host.. It works in the browser as it is relative to the main url in your browser.

SciLor avatar Jan 02 '25 13:01 SciLor

The cache function does not know where to download your image, as the Host URL is not set in the settings and you are using an absolute path without a host.. It works in the browser as it is relative to the main url in your browser.

I have also tried using a real URL that works in the browser, but the error remains the same.

[
{  
  "model": "Eigene - Adya - Classic",
  "title": "Adya - Classic",
  "series": "Adya", 
  "episodes": "Classic",
  "pic": "http://192.168.178.170/custom_img/Alben, Sampler & Singles/Alben & Singles/Adya/Classic/Cover.jpg"
}
]

etofi avatar Jan 02 '25 13:01 etofi

Did you try to urlencode the path? Especially the ampersands otherwise are a problems, beside the spaces.

SciLor avatar Jan 02 '25 14:01 SciLor

I have tried this "pic": "http://192.168.178.170/custom_img/Alben%2C%20Sampler%20%26%20Singles/Alben%20%26%20Singles/Adya/Classic/Cover.jpg"

Unfortunately also an error message

INFO |toniesJson.c:0280:tonies_readJson| Trying to read /teddycloud/config/tonies.custom.json with size 255
src/cache.c:194:35: runtime error: left shift of 237 by 24 places cannot be represented in type 'int'
INFO |web.c:0152:web_download| Downloading file from 'http://192.168.178.170/custom_img/Alben%2C%20Sampler%20%26%20Singles/Alben%20%26%20Singles/Adya/Classic/Cover.jpg' into local file '/teddycloud/data/cache/ED949ED74CBFDF1AD58E479C4E903EA87A043EC69FC356B1E7EC195BDFB9FDEC.jpg'
INFO |cloud_request.c:0200:web_request| Connecting to HTTP server 192.168.178.170:80...
INFO |cloud_request.c:0252:web_request|   trying IP: 192.168.178.170
ERROR|cloud_request.c:0344:web_request| Failed to read HTTP response header!
ERROR|web.c:0182:web_download| download failed, error=Buffer overflow [266]

I would also expect the string from the json file to be URI encoded in the script.

etofi avatar Jan 02 '25 16:01 etofi

are you trying to connect from one docker container to another on macvlan?

g3gg0 avatar Jan 05 '25 22:01 g3gg0

No I try to connect to a merged folder inside the TeddyCloud Container.

-v /volume1/music:/teddycloud/data/www/

etofi avatar Jan 05 '25 23:01 etofi