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

⌈⌋ ⎇ branch:  streamtuner2


Check-in [6d03cb84d3]

Overview
Comment:Allow Exif-wrapped JPEGs as well (not just JFIF regexp check). Comment on merging row["favourite"] merge via prepare_filters list.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6d03cb84d3c58b346bdff0cdb52e5b3036ea10e8
User & Date: mario on 2015-05-18 22:21:20
Other Links: manifest | tags
Context
2015-05-18
22:21
A bit more PEP8, without undoing all readability. check-in: 492cb2aacf user: mario tags: trunk
22:21
Allow Exif-wrapped JPEGs as well (not just JFIF regexp check). Comment on merging row["favourite"] merge via prepare_filters list. check-in: 6d03cb84d3 user: mario tags: trunk
22:19
Delay window title updating logic and ui_cht callback via uikit.do() wrapper.

Seems to fix both: - Gdk:ERROR:/build/buildd/gtk+2.0-2.24.23/gdk/gdkregion-generic.c:1114:miUnionNonO: assertion failed: (r->x1 < r->x2) - Error in `python': double free or corruption (fasttop): 0x0..... check-in: 8a68105eeb user: mario tags: trunk

Changes

Modified channels/__init__.py from [13cd81f0c1] to [00c8218319].

376
377
378
379
380
381
382

383
384


385
386
387
388
389
390
391
    def prepare(self, streams):
        for f in self.prepare_filters:
            map(f, streams)
        return streams

    # state icon: bookmark star, or deleted mark
    def prepare_filter_icons(self, row):

        if conf.show_bookmarks:# and "bookmarks" in self.parent.channels:
            row["favourite"] = self.parent.bookmarks.is_in(row.get("url", "file:///tmp/none"))


        if not row.get("state"):
            if row.get("favourite"):
                row["state"] = gtk.STOCK_ABOUT
            if row.get("deleted"):
                row["state"] = gtk.STOCK_DELETE









>
|

>
>







376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
    def prepare(self, streams):
        for f in self.prepare_filters:
            map(f, streams)
        return streams

    # state icon: bookmark star, or deleted mark
    def prepare_filter_icons(self, row):
        if conf.show_bookmarks:
            # and "bookmarks" in self.parent.channels:
            row["favourite"] = self.parent.bookmarks.is_in(row.get("url", "file:///tmp/none"))
            # this should really go into bookmarks plugin itself,
            # disadvantage: would decelerate processing loop further
        if not row.get("state"):
            if row.get("favourite"):
                row["state"] = gtk.STOCK_ABOUT
            if row.get("deleted"):
                row["state"] = gtk.STOCK_DELETE


Modified channels/favicon.py from [9b5655d121] to [87b5a0fc51].

270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
    

    
# Check for valid image binary, possibly convert or resize, then save to cache filename
def store_image(imgdata, fn, resize=None):

    # Convert accepted formats -- even PNG for filtering now
    if re.match(br'^(.PNG|GIF\d+|.{0,15}JFIF|\x00\x00\x01\x00|.{0,255}<svg[^>]+svg)', imgdata):
        try:
            # Read from byte/str
            image = Image.open(BytesIO(imgdata))
            log.FAVICON_IMAGE_TO_PNG(image, image.size, resize)

            # Resize
            if resize and image.size[0] > resize:







|







270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
    

    
# Check for valid image binary, possibly convert or resize, then save to cache filename
def store_image(imgdata, fn, resize=None):

    # Convert accepted formats -- even PNG for filtering now
    if re.match(br'^(.PNG|GIF\d+|.{0,15}(Exif|JFIF)|\x00\x00\x01\x00|.{0,255}<svg[^>]+svg)', imgdata):
        try:
            # Read from byte/str
            image = Image.open(BytesIO(imgdata))
            log.FAVICON_IMAGE_TO_PNG(image, image.size, resize)

            # Resize
            if resize and image.size[0] > resize: