Internet radio browser GUI for music/video streams from various directory services.

⌈⌋ ⎇ branch:  streamtuner2


Diff

Differences From Artifact [11f92592f3]:

To Artifact [ae8e7ee1ba]:

  • File channels/__init__.py — part of check-in [ea628d6426] at 2015-04-08 17:59:53 on branch trunk — Remove extraneous class wrapper action.action. Start to regroup listformat mapping (pls-url → m3u-fn rewrites). Will need some heuristics, as depending just on the channel.listformat assumption won't work in practice (some .pls servers actually host direct server links, or occasionally .m3u references even). Currently does nothing, just returns the pls/etc URL. (user: mario, size: 21728) [annotate] [blame] [check-ins using]

449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
        if row.get("url"):

            # parameters
            audioformat = row.get("format", self.audioformat)
            listformat = row.get("listformat", self.listformat)

            # invoke audio player
            action.action.play(row["url"], audioformat, listformat)




    #--------------------------- utility functions -----------------------

    







|







449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
        if row.get("url"):

            # parameters
            audioformat = row.get("format", self.audioformat)
            listformat = row.get("listformat", self.listformat)

            # invoke audio player
            action.play(row["url"], audioformat, listformat)




    #--------------------------- utility functions -----------------------

    
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
            "ogg":"ogg", "ogm":"ogg", "xiph":"ogg", "vorbis":"ogg", "vnd.xiph.vorbis":"ogg",
            "mp3":"mpeg", "mp":"mpeg", "mp2":"mpeg", "mpc":"mpeg", "mps":"mpeg",
            "aac+":"aac", "aacp":"aac",
            "realaudio":"x-pn-realaudio", "real":"x-pn-realaudio", "ra":"x-pn-realaudio", "ram":"x-pn-realaudio", "rm":"x-pn-realaudio",
            # yes, we do video
            "flv":"video/flv", "mp4":"video/mp4",
        }
        map.update(action.action.lt)   # list type formats (.m3u .pls and .xspf)
        if map.get(s):
            s = map[s]
        # add prefix:
        if s.find("/") < 1:
            s = "audio/" + s
        #
        return s







|







476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
            "ogg":"ogg", "ogm":"ogg", "xiph":"ogg", "vorbis":"ogg", "vnd.xiph.vorbis":"ogg",
            "mp3":"mpeg", "mp":"mpeg", "mp2":"mpeg", "mpc":"mpeg", "mps":"mpeg",
            "aac+":"aac", "aacp":"aac",
            "realaudio":"x-pn-realaudio", "real":"x-pn-realaudio", "ra":"x-pn-realaudio", "ram":"x-pn-realaudio", "rm":"x-pn-realaudio",
            # yes, we do video
            "flv":"video/flv", "mp4":"video/mp4",
        }
        map.update(action.lt)   # list type formats (.m3u .pls and .xspf)
        if map.get(s):
            s = map[s]
        # add prefix:
        if s.find("/") < 1:
            s = "audio/" + s
        #
        return s