Hey, Rainmeter community! I am new to Rainmeter, even though I've been eyeing it for the better part of a decade. Please forgive me if I am missing something obvious here.
I am in the midst of modifying some existing CAD skins to display NowPlaying data from my Jellyfin server. I am using mistic100's NowPlayingJellyfin plugin, which seems to be working overall. Said plugin does not currently support media controls, so that's been a bummer, but in the meantime, what I am struggling with is getting the album art to display. According to the logs, the Image meter is failing to fetch the image from my server, and the culprit appears to be the fact that it always tacks on ".png" at the end of the request URL, while the valid URL should not include a file extension at all. I looked at the meter's official documentation and learned that this is normal behavior. Unfortunately, while said documentation explicitly mentions an exception for the undesired file extension, it stops short of offering any solutions or workarounds.
I have tried using %N syntax without ".png", but that either still passes in the file extension or doesn't even parse at all. I have also tried using both regular and regex substitution, each in the measure and in the meter, to no avail. These solutions result in identical errors in each of the skins I've modified.
Any ideas? I have navigated to the request URL without the file extension in a browser, and it works just fine, so I am 95% sure that that is the culprit.
Thanks in advance!
It is currently May 10th, 2024, 12:14 am
Getting ImageName not to append file extension
-
- Posts: 5
- Joined: December 7th, 2023, 5:05 pm
Getting ImageName not to append file extension
Last edited by SightSpirit on December 8th, 2023, 3:24 pm, edited 1 time in total.
-
- Rainmeter Sage
- Posts: 7212
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Getting ImageName not to append file extension
The Image meter only works with local image files, not URLs. So, the image file must first be "downloaded" locally before being able to be used by the Image meter normally, with the extension and everything.SightSpirit wrote: ↑December 7th, 2023, 5:23 pm Hey, Rainmeter community! I am new to Rainmeter, even though I've been eyeing it for the better part of a decade. Please forgive me if I am missing something obvious here.
I am in the midst of modifying some existing CAD skins to display NowPlaying data from my Jellyfin server. I am using mistic100's NowPlayingJellyfin plugin, which seems to be working overall. Said plugin does not currently support media controls, so that's been a bummer, but in the meantime, what I am struggling with is getting the album art to display. According to the logs, the Image meter is failing to fetch the image from my server, and the culprit appears to be the fact that it always tacks on ".png" at the end of the request URL, while the valid URL should not include a file extension at all. I looked at the meter's official documentation and learned that this is normal behavior. Unfortunately, while said documentation explicitly mentions an exception for the undesired file extension, it stops short of offering any solutions or workarounds.
I have tried using %N syntax without ".png", but that either still passes in the file extension or doesn't even parse at all. I have also tried using both regular and regex substitution, each in the measure and in the meter, to no avail. These solutions result in identical errors in each of the skins I've modified.
Any ideas? I have navigated to the request URL without the file extension in a browser, and it works just fine, so I am 95% sure that that is the culprit.
Thanks in advance!
To handle accessing the URL and downloading the desired image, you should look into WebParser measures:
https://docs.rainmeter.net/manual/measures/webparser/
See the URL, Download and DownloadFile options for more details on achieving what you're after.
-
- Rainmeter Sage
- Posts: 16207
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Getting ImageName not to append file extension
Besides Yincognito's correct description, you should have to post a code you're working with. Posting only the plugin is not enough.
-
- Posts: 5
- Joined: December 7th, 2023, 5:05 pm
Re: Getting ImageName not to append file extension
Alright, here are the relevant parts of what I have so far:
(Adapted from Vin Star's Blurry Music Player)
I think I'm on the right track? It's not erroring out anymore, but it still doesn't display the image. Or seem to download it, either.
Code: Select all
[MeasureCover]
Measure=Plugin
Plugin=NowPlayingJellyfin
PlayerName=MeasureArtist
PlayerType=COVER
...
[ArtDownload]
Measure=WebParser
URL=[MeasureCover]
Download=1
DynamicVariables=1
FinishAction=[!UpdateMeasure MeterAlbumArt]
[MeterAlbumArt]
Meter=Image
MeasureName=ArtDownload
X=(38*#Scale#)
Y=(40*#Scale#)
W=(50*#Scale#)
MaskImageName=#@#Mask.png
I think I'm on the right track? It's not erroring out anymore, but it still doesn't display the image. Or seem to download it, either.
-
- Rainmeter Sage
- Posts: 16207
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Getting ImageName not to append file extension
Try adding an OnChangeAction=[!CommandMeasure "ArtDownload" "Update"] option to the [MeasureCover] measure.SightSpirit wrote: ↑December 7th, 2023, 8:39 pm Alright, here are the relevant parts of what I have so far:
-
- Posts: 5
- Joined: December 7th, 2023, 5:05 pm
-
- Rainmeter Sage
- Posts: 16207
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Getting ImageName not to append file extension
Alright, just to check if the measure is working properly do the followings:SightSpirit wrote: ↑December 7th, 2023, 8:58 pm That was a good idea, but it seems not to have done the trick.
- Add a H=(50*#Scale#) option to the [MeterAlbumArt] meter.
- Also add a SolidColor=0,0,0,100 option to the same [MeterAlbumArt] meter. With these two options, you'll get a light gray area where the image should be shown.
- Finally add the following option to the [MeterAlbumArt] meter: LeftMouseUpAction=[!CommandMeasure "ArtDownload" "Update"].
-
- Rainmeter Sage
- Posts: 7212
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Getting ImageName not to append file extension
Besides balala's suggestions...
EDIT: Also...
because MeasureCover is not a WebParser parent measure, but just some measure you want its String value from (this & is specific to the WebParser URL option in such cases, though it's part of the nested syntax for measures, by the way).
MeterAlbumArt is a METER, not a MEASURE, so it should be !UpdateMeter. Plus, a !Redraw will make the changes visible afterwards.FinishAction=[!UpdateMeasure MeterAlbumArt]
EDIT: Also...
should be:URL=[MeasureCover]
Code: Select all
URL=[&MeasureCover]
-
- Posts: 5
- Joined: December 7th, 2023, 5:05 pm
Re: Getting ImageName not to append file extension
Thanks again for the continued help, folks.
I am so close now! It is now fetching the file successfully, but the download is not being assigned a file extension, so it is not displaying. How can I get it to append ".png" to filename after download?
I am so close now! It is now fetching the file successfully, but the download is not being assigned a file extension, so it is not displaying. How can I get it to append ".png" to filename after download?
-
- Rainmeter Sage
- Posts: 7212
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Getting ImageName not to append file extension
You have two choices:SightSpirit wrote: ↑December 8th, 2023, 2:22 pm Thanks again for the continued help, folks.
I am so close now! It is now fetching the file successfully, but the download is not being assigned a file extension, so it is not displaying. How can I get it to append ".png" to filename after download?
1) use the download name even if it doesn't have an extension, e.g.:
Code: Select all
...
[ArtDownload]
...
Download=1
...
[MeterAlbumArt]
...
Meter=Image
MeasureName=ArtDownload
ImageName=%1.
...
Code: Select all
...
[ArtDownload]
...
Download=1
DownloadFile=SomeFile.SomeExtension
...
[MeterAlbumArt]
...
Meter=Image
MeasureName=ArtDownload
...