maddox / wallop

📺 A transcoding server for your HDHomeRun Prime
167 stars 41 forks source link

Cannot configure images for channels with decimal points #13

Open computmaxer opened 10 years ago

computmaxer commented 10 years ago

Perhaps I am just using the toml syntax wrong, but when I set the image for a channel with a decimal place, like 5.1, I get this:

Failed to match sequence (ALL_SPACE (KEY_GROUP / KEY_VALUE / COMMENT_LINE){0, } ALL_SPACE) at line 10 char 1.
`- Don't know what to do with "5.1 = \"abc" at line 10 char 1.

config:

[channel_logos]
5.1 = "abc.png"
maddox commented 10 years ago

Ahh, its probably a bug in toml. That's kinda tricky. Try quoting the key "5.1" and see if that works.

computmaxer commented 10 years ago

Hmm, nope. Same kind of error.

Failed to match sequence (ALL_SPACE (KEY_GROUP / KEY_VALUE / COMMENT_LINE){0, } ALL_SPACE) at line 10 char 1.
`- Don't know what to do with "\"5.1\" = \"a" at line 10 char 1.

That's too bad for toml. I may alter wallop a bit to read in channel image definitions from a different file type for my use, since all of my channels have decimal points at the moment.

maddox commented 10 years ago

Sorry about this. This is very unfortunate. We can work on just using a new format inside the toml.

Feel free to submit a change.

On Sep 23, 2013, at 1:45 PM, Max Peterson notifications@github.com wrote:

Hmm, nope. Same kind of error.

Failed to match sequence (ALL_SPACE (KEY_GROUP / KEY_VALUE / COMMENT_LINE){0, } ALL_SPACE) at line 10 char 1. `- Don't know what to do with "\"5.1\" = \"a" at line 10 char 1. That's too bad for toml. I may alter wallop a bit to read in channel image definitions from a different file type for my use, since all of my channels have decimal points at the moment.

— Reply to this email directly or view it on GitHub.

computmaxer commented 10 years ago

Here is a potential fix: https://github.com/computmaxer/wallop/commit/940574a1c4bc15d552c174f5fdcbd0b8ffade045

I defined the channel logos like this:

5_1 = "abc.png"
8_1 = "cbs.png"
13_1 = "nbc.png"
17_1 = "fox.png"

and then simply used a string substitution before checking the config for the channel number.

I'm not in love with this solution but it is easy and it works. If you think it is okay I'll make a pull request!

maddox commented 10 years ago

wow, gross, hahah. Sit on it for a while, at least you have it working for yourself. that's not very clear in my opinion. I'll see if i can come up with something.

computmaxer commented 10 years ago

Yeah I definitely agree. I'll also try to think of other solutions. I tried starting each line with a letter, like channel_5.1 but it still chokes on the decimal point.

JerseyDevil6 commented 10 years ago

Any real solution for this one yet? All of my channels have decimal points too.