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"] = main.channel().listformat
           
        # append to storage
        self.streams["favourite"].append(row)
        self.save()
        self.load(self.default)
        self.urls.append(row["url"])
 | 
|
  | 
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
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 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
 | 
|
  | 
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
 |