milaq / YCast

Self hosted vTuner internet radio service emulation
Other
243 stars 93 forks source link

Has icon feature been implemented? #24

Closed emtee-bc closed 4 years ago

emtee-bc commented 4 years ago

I have been trying to add station JPEG files to the YCast server and so far nothing appears to work. I am brand new to Flask and while I have some ideas from viewing the YCast code, I don't have direct experience with Flask.

I did insert a logging.error() line into station_icons.py in the get_icons() method to display both the cache_path and the station_icon_file, but there is nothing in the log.

This is leaving me to believe that icon file functionality has not yet been coded into YCast.

Could you confirm if icon file functionality works, please?

milaq commented 4 years ago

Yes, station icons are implemented and caching should be working.

Have a look at the home directory of the user running YCast. There should be a folder named .ycast. The icon cache resides in there.

You may also run YCast with the -d argument to enable debug logging. Maybe something went wrong creating the cache.

emtee-bc commented 4 years ago

I do have a number of JPEG files for my customised list of stations in stations.yml.

I am starting YCast as a service as it is running on a headless Raspberry Pi 2. I did find the .ycast folder in the root user home folder.

What's not clear from the README is where user supplied JPEG files for the custom stations should be stored and how the file should be named.

From my exploring of your code, it looks like the icon file will be named 'MY_ stationid' without the JPEG extension. It also appears that the maximum size of the JPEG file should be 290 x 290 pixels.

Can you describe:

  1. Where the files should be stored for the custom stations?
  2. What the file should be named for a specific station?
  3. Resolution size of the image?

Thanks in advance. Mark

milaq commented 4 years ago

Icons are only supported for Radiobrowser stations at the moment.

Until we can supply more information besides a name and a url for custom stations, icons (and other tags) are not supported.

alxrdn commented 3 years ago

From my exploring of your code, it looks like the icon file will be named 'MY_ stationid' without the JPEG extension. It also appears that the maximum size of the JPEG file should be 290 x 290 pixels.

hi @emtee-bc you can easily hack server.py code to have it serve cache icons that you will manually store in .ycast/cache/icons with MY_stationid filename (no extension, 290px max) : simply comment the 3 lines

    if not hasattr(station, 'icon') or not station.icon:
        logging.warning("No icon information found for station with id '%s'", stationid)
        abort(404)

(don't forget to remove pycache)