2020-04-07, 15:12
it's banned so I (or SlyGuy) won't support it
javascript:const CHANNELS = ['Discovery', 'Discovery', 'TBS', 'TBS', 'CNN'];
const 1stWay = [...new Set(CHANNELS)];
const 2ndWay = CHANNELS.filter((channel, index) => channel.indexOf(channel) == index);
const 3rdWay = CHANNLS.reduce((unique, channel) => unique.includes(channel) ? unique : [...unique, channel], []);
(2020-04-17, 19:41)Zewkin Wrote: Great addon, thanks a lot!made a typo, of couse 2nd should be
May I ask for a small feature request? It would be nice to have a possibility to remove duplicates from the resulting playlist.
I'm not good enough in Python, but in my 1st chooise language (JS) this could be done very easily in many different ways, like
javascript:const CHANNELS = ['Discovery', 'Discovery', 'TBS', 'TBS', 'CNN'];
const 1stWay = [...new Set(CHANNELS)];
const 2ndWay = CHANNELS.filter((channel, index) => channel.indexOf(channel) == index);
const 3rdWay = CHANNLS.reduce((unique, channel) => unique.includes(channel) ? unique : [...unique, channel], []);
I knon Python is a very powerful tool, I bet this could be implemented very easily.
Thanks again work a great job you've done!
javascript:const 2ndWay = CHANNELS.filter((channel, index) => CHANNELS.filter(channel) == index);
javascript:const 2ndWay = CHANNELS.filter((channel, index) => CHANNELS.indexOf(channel) == index);
(2020-04-17, 19:47)Zewkin Wrote: Damn, this forum does not allow to edit messages
(2020-04-17, 19:47)Zewkin Wrote: Damn, this forum does not allow to edit messages