Radio Stream Selection

Suggestions/requests/ideas for RuneAudio core features and functions

Radio Stream Selection

Postby andfor » 28 Sep 2017, 18:54

Hi

It might just be me, but I find it annoying that Rune adds radio streams to the end of the queue when you double-click on a station in the library.

Switching between stations means that I often end up with a long list with the same station listed several times.

I think it would be better if, for radio stations only, a double-click means 'Add Replace and Play' rather than just 'Add'. That way you could switch stations easily without creating a long list in the queue.

Obviously I wouldn't want this behaviour to apply to choosing music from the attached music library.

Maybe this would be more complicated to achieve than I realise, but some help with how to achieve this by editing the code would be appreciated if at all possible without breaking the whole thing!

Thanks
User avatar
andfor
 
Posts: 57
Joined: 26 Jun 2017, 15:48
Location: Birmingham, UK

Re: Radio Stream Selection

Postby hondagx35 » 28 Sep 2017, 22:10

Hi ,

you have to edit /srv/http/assets/js/runeui.js
from:
Code: Select all
        // double click on Library list entry
        db.on('dblclick', 'li', function(e) {
            var el = $(this);
            if (!$(e.target).hasClass('db-action')) {
                $('li.active', '#database-entries').removeClass('active');
                el.addClass('active');
                var path = el.data('path');
                // console.log('doubleclicked path = ', path);
                if (el.hasClass('db-spotify')) {
                    path = el.attr('data-plid') + '-' + el.attr('data-path');
                    getDB({
                        cmd: 'spaddplay',
                        path: path,
                        querytype: 'spotify-track'
                    });
      } else {
                    path = (el.hasClass('db-dirble')) ? path.split(' | ')[1] : path;
                    getDB({
                        cmd: 'addplay',
                        path: path
                    });
                }
            }
        });

to:
Code: Select all
        // double click on Library list entry
        db.on('dblclick', 'li', function(e) {
            var el = $(this);
            if (!$(e.target).hasClass('db-action')) {
                $('li.active', '#database-entries').removeClass('active');
                el.addClass('active');
                var path = el.data('path');
                // console.log('doubleclicked path = ', path);
                if (el.hasClass('db-spotify')) {
                    path = el.attr('data-plid') + '-' + el.attr('data-path');
                    getDB({
                        cmd: 'spaddplay',
                        path: path,
                        querytype: 'spotify-track'
                    });
                } else if (path.startsWith('Webradio')){
                    getDB({
                        cmd: 'addreplaceplay',
                        path: path
                    });
            } else {
                    path = (el.hasClass('db-dirble')) ? path.split(' | ')[1] : path;
                    getDB({
                        cmd: 'addplay',
                        path: path
                    });
                }
            }
        });

This also has to be minified (runeui.min.js) or you have to switch to dev mode.

Frank
User avatar
hondagx35
 
Posts: 3041
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: Radio Stream Selection

Postby andfor » 30 Sep 2017, 09:41

Hi Frank,

Thanks that worked great.

This might be greedy of me, but is there a way to do this with a single click? I've tried adding the code you gave me to the library browsing code above the section you altered in various places, but I'm not savvy enough to know what I'm doing really.

Think of all the time I could save by only clicking once! :D That's a huge increase in UI efficiency.

Thanks again.
User avatar
andfor
 
Posts: 57
Joined: 26 Jun 2017, 15:48
Location: Birmingham, UK

Re: Radio Stream Selection

Postby hondagx35 » 30 Sep 2017, 10:52

Hi,

try:
Code: Select all
                } else if (el.hasClass('db-webradio-add')) {
                    $('#modal-webradio-add').modal();
                }
            }
        });


Code: Select all
                } else if (el.hasClass('db-webradio-add')) {
                    $('#modal-webradio-add').modal();
                } else {
                    path = el.data('path');
                   if (path.startsWith('Webradio')){
                       getDB({
                            cmd: 'addreplaceplay',
                            path: path
                        });
                    }
                }
            }
        });


Frank
User avatar
hondagx35
 
Posts: 3041
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: Radio Stream Selection

Postby andfor » 01 Oct 2017, 09:45

Thanks Frank!

That works.
User avatar
andfor
 
Posts: 57
Joined: 26 Jun 2017, 15:48
Location: Birmingham, UK

support RuneAudio Donate with PayPal


Return to Feature request

Who is online

Users browsing this forum: No registered users and 0 guests