milaq / YCast

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

Maintain order for custom stations #23

Open emtee-bc opened 4 years ago

emtee-bc commented 4 years ago

Currently reading My Stations from stations.yml results in a random order for both the categories as well as the stations within each category. This is a "feature" of PyYAML and python dictionaries.

I would like to see the order of the categories and stations as they appear in the station.yml file.

I installed oyaml (https://github.com/wimglenn/oyaml) and changed line 4 of my_stations.py from: import yaml to: import oyaml as yaml

This transparently produced the desired result.

Please consider this for the default behaviour of YCast.

P.S. I am testing with a Yamaha R-N301 and YCast is working beautifully. YCast is installed on a Raspberry Pi 2 that is also running Pi-Hole. Thanks for creating this project.

milaq commented 4 years ago

Thanks for your ideas :+1: In the short term I'll think about your suggestion.

In the long term: We'll probably utilize a database (I am imagining SQLite) for storing custom stations and other stuff. This way the order will be kept either way.

I'll leave this open as a reminder.

Cheers