Check-in [5a772b3c64]
Overview
Comment: | Fix main. references from bookmarks callback. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
5a772b3c641ec20eb5887adfba7f050b |
User & Date: | mario on 2015-04-07 19:48:18 |
Other Links: | manifest | tags |
Context
2015-04-07
| ||
19:49 | Split up ExtensionsβΊ submenus. Register major plugins (timer, myoggradio, radiotray) as direct menu entries, but complex extensions (exportcat) as subentry still. check-in: a872fb7d36 user: mario tags: trunk | |
19:48 | Fix main. references from bookmarks callback. check-in: 5a772b3c64 user: mario tags: trunk | |
19:48 | Got rid of switchy() expression, use plain `cond and val or ...` chain. check-in: 30dd0c5b1f user: mario tags: trunk | |
Changes
Modified channels/bookmarks.py from [dbf59ee271] to [2e6c240bb2].
︙ | ︙ | |||
105 106 107 108 109 110 111 | def add(self, row): # normalize data (this row originated in a gtk+ widget) row["favourite"] = 1 if row.get("favicon"): row["favicon"] = favicon.file(row.get("homepage")) if not row.get("listformat"): | | | 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | def add(self, row): # normalize data (this row originated in a gtk+ widget) row["favourite"] = 1 if row.get("favicon"): row["favicon"] = favicon.file(row.get("homepage")) if not row.get("listformat"): row["listformat"] = self.main.channel().listformat # append to storage self.streams["favourite"].append(row) self.save() self.load(self.default) self.urls.append(row["url"]) |
︙ | ︙ | |||
154 155 156 157 158 159 160 | # First we'll generate a list of current bookmark stream urls, and then # remove all but those from the currently UPDATED_channel + category. # This step is most likely redundant, but prevents accidently re-rewriting # stations that are in two channels (=duplicates with different PLS urls). check = {"http//": "[row]"} check = dict((row.get("url", "http//"),row) for row in fav) # walk through all channels/streams | | | 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | # First we'll generate a list of current bookmark stream urls, and then # remove all but those from the currently UPDATED_channel + category. # This step is most likely redundant, but prevents accidently re-rewriting # stations that are in two channels (=duplicates with different PLS urls). check = {"http//": "[row]"} check = dict((row.get("url", "http//"),row) for row in fav) # walk through all channels/streams for chname,channel in self.main.channels.items(): for cat,streams in channel.streams.items(): # keep the potentially changed rows if (chname == updated_channel) and (cat == updated_category): freshened_streams = streams # remove unchanged urls/rows |
︙ | ︙ |