Check-in [bd29eb4ee9]
Overview
Comment: | Add server-search, slim down search dialog. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
bd29eb4ee994b49a1ce766401767c5af |
User & Date: | mario on 2014-06-02 01:43:54 |
Other Links: | manifest | tags |
Context
2014-06-03
| ||
00:29 |
Search dialog offers (x) all channels or (x) just current for server+cache scan
again. Removed search="" parameter from channels that don't implement it.
(To remove extraneous .has_search channel attribute again somewhen..)
External: Xiph IO cache ?search= should be changed to work on station titles instead of genres. check-in: ac8632bc29 user: mario tags: trunk | |
2014-06-02
| ||
01:43 | Add server-search, slim down search dialog. check-in: bd29eb4ee9 user: mario tags: trunk | |
01:43 | Remove force= parameter from update_streams check-in: 4b66ed9ef8 user: mario tags: trunk | |
Changes
Modified channels/youtube.py from [26bc9c21d4] to [cd9934e99a].
︙ | ︙ | |||
59 60 61 62 63 64 65 66 67 68 69 70 71 72 | class youtube (ChannelPlugin): # description title = "Youtube" module = "youtube" homepage = "http://www.youtube.com/" listformat = "url/youtube" fmt = "video/youtube" titles = dict( genre="Channel", title="Title", playing="Playlist", bitrate=False, listeners=False ) # API config service = { 2: [ "http://gdata.youtube.com/", { | > | 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | class youtube (ChannelPlugin): # description title = "Youtube" module = "youtube" homepage = "http://www.youtube.com/" listformat = "url/youtube" has_search = True fmt = "video/youtube" titles = dict( genre="Channel", title="Title", playing="Playlist", bitrate=False, listeners=False ) # API config service = { 2: [ "http://gdata.youtube.com/", { |
︙ | ︙ | |||
83 84 85 86 87 88 89 | "fields": "pageInfo,nextPageToken,items(id,snippet(title,thumbnails/default/url,channelTitle))", } ] } categories = [ "mostPopular", | | | 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | "fields": "pageInfo,nextPageToken,items(id,snippet(title,thumbnails/default/url,channelTitle))", } ] } categories = [ "mostPopular", ["Music", "Comedy", "Movies", "Shows", "Trailers", "Film & Animation", "Entertainment", "News & Politics"], "topics", ["Pop", "Billboard charts", "Rock", "Hip Hop", "Classical", "Soundtrack", "Ambient", "Jazz", "Blues", "Soul", "Country", "Disco", "Dance", "House", "Trance", "Techno", "Electronica"], "my channels", ["Key of Awesome", "Pentatonix"] ] |
︙ | ︙ | |||
173 174 175 176 177 178 179 | # just a static list for now def update_categories(self): i = self.categories.index("my channels") + 1 self.categories[i] = [ title.strip() for title in conf.youtube_channels.split(",") ] # retrieve and parse | | > > > > > | | 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | # just a static list for now def update_categories(self): i = self.categories.index("my channels") + 1 self.categories[i] = [ title.strip() for title in conf.youtube_channels.split(",") ] # retrieve and parse def update_streams(self, cat, search=None): entries = [] channels = self.categories[self.categories.index("my channels") + 1] # plain search request for videos if search is not None: for row in self.api("search", type="video", regionCode=conf.youtube_region, q=search): entries.append( self.wrap3(row, {"genre": "Youtube"}) ) # Most Popular elif cat == "mostPopular": #for row in self.api("feeds/api/standardfeeds/%s/most_popular"%conf.youtube_region, ver=2): # entries.append(self.wrap2(row)) for row in self.api("videos", chart="mostPopular", regionCode=conf.youtube_region): entries.append( self.wrap3(row, {"genre": "mostPopular"}) ) # Categories elif cat in self.videocat_id: |
︙ | ︙ | |||
213 214 215 216 217 218 219 | # items (videos) for row in self.api("playlistItems", playlistId=playlist["id"], fields="items(snippet(title,resourceId/videoId,description))"): entries.append(self.wrap3(row, {"genre": cat, "playing": playlist["snippet"]["title"]})) self.update_streams_partially_done(entries) self.parent.status(i / 15.0) | < < < < | 219 220 221 222 223 224 225 226 227 228 229 230 231 232 | # items (videos) for row in self.api("playlistItems", playlistId=playlist["id"], fields="items(snippet(title,resourceId/videoId,description))"): entries.append(self.wrap3(row, {"genre": cat, "playing": playlist["snippet"]["title"]})) self.update_streams_partially_done(entries) self.parent.status(i / 15.0) # empty entries else: entries = [dict(title="Placeholder for subcategories", genre="./.", playing="./.", url="http://youtube.com/")] # done return entries |
︙ | ︙ |
Modified gtk2.xml from [b8c495c303] to [a3cab018cd].
︙ | ︙ | |||
1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 | <property name="label" translatable="yes"><big><b>Configuration Settings</b></big></property> <property name="use_markup">True</property> </object> </child> </object> </child> </object> <object class="GtkDialog" id="search_dialog"> <property name="can_focus">False</property> <property name="border_width">5</property> <property name="title" translatable="yes">station search</property> <property name="window_position">center-on-parent</property> <property name="type_hint">dialog</property> <property name="deletable">False</property> | > > > > > > > > > > | 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 | <property name="label" translatable="yes"><big><b>Configuration Settings</b></big></property> <property name="use_markup">True</property> </object> </child> </object> </child> </object> <object class="GtkImage" id="image1"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="stock">gtk-harddisk</property> </object> <object class="GtkImage" id="image2"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="stock">gtk-add</property> </object> <object class="GtkDialog" id="search_dialog"> <property name="can_focus">False</property> <property name="border_width">5</property> <property name="title" translatable="yes">station search</property> <property name="window_position">center-on-parent</property> <property name="type_hint">dialog</property> <property name="deletable">False</property> |
︙ | ︙ | |||
1087 1088 1089 1090 1091 1092 1093 | <property name="spacing">2</property> <child internal-child="action_area"> <object class="GtkHButtonBox" id="dialog-action_area1"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="layout_style">end</property> <child> | < < < < < < < | < < < < < < < < | < < < < < < < < < < < < < | < < < < < < < < < < < < < | < < < < < < < < < < < < < < < < | < < < < | 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 | <property name="spacing">2</property> <child internal-child="action_area"> <object class="GtkHButtonBox" id="dialog-action_area1"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="layout_style">end</property> <child> <placeholder/> </child> <child> <placeholder/> </child> <child> <placeholder/> </child> <child> <placeholder/> </child> <child> <placeholder/> </child> </object> <packing> <property name="expand">False</property> <property name="fill">False</property> <property name="pack_type">end</property> <property name="position">0</property> |
︙ | ︙ | |||
1189 1190 1191 1192 1193 1194 1195 | <packing> <property name="expand">True</property> <property name="fill">True</property> <property name="position">0</property> </packing> </child> <child> | < < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 | <packing> <property name="expand">True</property> <property name="fill">True</property> <property name="position">0</property> </packing> </child> <child> <placeholder/> </child> <child> <object class="GtkHBox" id="hbox1"> <property name="visible">True</property> <property name="can_focus">False</property> <child> <object class="GtkLabel" id="label1"> |
︙ | ︙ | |||
2080 2081 2082 2083 2084 2085 2086 | <packing> <property name="expand">True</property> <property name="fill">True</property> <property name="position">2</property> </packing> </child> <child> | > > > > > > | < | < | | | > > > > | > > > | | | | | | > | | > < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 | <packing> <property name="expand">True</property> <property name="fill">True</property> <property name="position">2</property> </packing> </child> <child> <placeholder/> </child> <child> <placeholder/> </child> <child> <object class="GtkHBox" id="hbox3"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="spacing">20</property> <child> <object class="GtkButton" id="cache_search"> <property name="label" translatable="yes">Cache _find</property> <property name="visible">True</property> <property name="can_focus">False</property> <property name="can_default">True</property> <property name="has_default">True</property> <property name="receives_default">True</property> <property name="tooltip_text" translatable="yes">Start searching for above search term in the currently loaded station lists. Doesn't find *new* information, just looks through the known data.</property> <property name="image">image1</property> <property name="relief">half</property> <property name="use_underline">True</property> <accelerator key="Return" signal="activate"/> <signal name="clicked" handler="search_go" swapped="no"/> </object> <packing> <property name="expand">True</property> <property name="fill">True</property> <property name="position">0</property> </packing> </child> <child> <object class="GtkButton" id="server_search"> <property name="label" translatable="yes">Server _search</property> <property name="visible">True</property> <property name="can_focus">False</property> <property name="receives_default">True</property> <property name="tooltip_text" translatable="yes">Instead of doing a cache search, go through the search functions on the directory service homepages. (UNIMPLEMENTED)</property> <property name="image">image2</property> <property name="use_underline">True</property> <signal name="clicked" handler="search_srv" swapped="no"/> </object> <packing> <property name="expand">True</property> <property name="fill">True</property> <property name="position">1</property> </packing> </child> </object> <packing> <property name="expand">True</property> <property name="fill">True</property> <property name="position">5</property> </packing> </child> </object> <packing> <property name="expand">True</property> <property name="fill">True</property> <property name="position">1</property> </packing> </child> </object> </child> </object> <object class="GtkMenu" id="streamactions"> <property name="visible">True</property> <property name="can_focus">False</property> <child> <object class="GtkMenuItem" id="streamactions_play"> <property name="visible">True</property> |
︙ | ︙ | |||
2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 | </child> <child> <placeholder/> </child> <child> <placeholder/> </child> <child> <object class="GtkEntry" id="timer_value"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="invisible_char">●</property> <property name="text" translatable="yes">Fri,Sat 20:00-21:00</property> <property name="primary_icon_activatable">False</property> <property name="secondary_icon_activatable">False</property> <property name="primary_icon_sensitive">True</property> <property name="secondary_icon_sensitive">True</property> </object> <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> <property name="top_attach">1</property> <property name="bottom_attach">2</property> </packing> </child> <child> <placeholder/> </child> <child> <placeholder/> </child> <child> | > > > > > > > > > > > > > > > > > > > > > | 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 | </child> <child> <placeholder/> </child> <child> <placeholder/> </child> <child> <placeholder/> </child> <child> <placeholder/> </child> <child> <placeholder/> </child> <child> <placeholder/> </child> <child> <placeholder/> </child> <child> <placeholder/> </child> <child> <object class="GtkEntry" id="timer_value"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="invisible_char">●</property> <property name="text" translatable="yes">Fri,Sat 20:00-21:00</property> <property name="primary_icon_activatable">False</property> <property name="secondary_icon_activatable">False</property> <property name="primary_icon_sensitive">True</property> <property name="secondary_icon_sensitive">True</property> </object> <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> <property name="top_attach">1</property> <property name="bottom_attach">2</property> </packing> </child> <child> <placeholder/> </child> <child> <placeholder/> </child> <child> <placeholder/> </child> <child> |
︙ | ︙ | |||
3292 3293 3294 3295 3296 3297 3298 | <property name="can_focus">False</property> <child> <object class="GtkMenuItem" id="menu_bookmark"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">bookmark</property> <property name="use_underline">True</property> | < > < > | | | 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 | <property name="can_focus">False</property> <child> <object class="GtkMenuItem" id="menu_bookmark"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">bookmark</property> <property name="use_underline">True</property> <accelerator key="d" signal="activate" modifiers="GDK_CONTROL_MASK"/> <accelerator key="F8" signal="activate"/> <signal name="activate" handler="bookmark" swapped="no"/> </object> </child> <child> <object class="GtkImageMenuItem" id="imagemenuitem_saveas"> <property name="label">gtk-save-as</property> <property name="visible">True</property> <property name="can_focus">False</property> <property name="use_underline">True</property> <property name="use_stock">True</property> <accelerator key="F2" signal="activate"/> <accelerator key="s" signal="activate" modifiers="GDK_CONTROL_MASK"/> <signal name="activate" handler="save_as" swapped="no"/> </object> </child> <child> <object class="GtkImageMenuItem" id="gtk-edit"> <property name="label">gtk-edit</property> <property name="visible">True</property> <property name="can_focus">False</property> <property name="use_underline">True</property> <property name="use_stock">True</property> <accelerator key="F3" signal="activate"/> <accelerator key="space" signal="activate" modifiers="GDK_MOD1_MASK"/> <accelerator key="Return" signal="activate" modifiers="GDK_MOD1_MASK"/> <signal name="activate" handler="streamedit_open" swapped="no"/> </object> </child> <child> <object class="GtkMenuItem" id="extensions0"> <property name="visible">True</property> <property name="can_focus">False</property> |
︙ | ︙ | |||
3391 3392 3393 3394 3395 3396 3397 | <child> <object class="GtkImageMenuItem" id="menuitem_delete"> <property name="label">gtk-delete</property> <property name="visible">True</property> <property name="can_focus">False</property> <property name="use_underline">True</property> <property name="use_stock">True</property> | < > | 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 | <child> <object class="GtkImageMenuItem" id="menuitem_delete"> <property name="label">gtk-delete</property> <property name="visible">True</property> <property name="can_focus">False</property> <property name="use_underline">True</property> <property name="use_stock">True</property> <accelerator key="Delete" signal="activate"/> <accelerator key="x" signal="activate" modifiers="GDK_CONTROL_MASK"/> <signal name="activate" handler="delete_entry" swapped="no"/> </object> </child> <child> <object class="GtkImageMenuItem" id="imagemenuitem8"> <property name="label">gtk-find</property> <property name="visible">True</property> |
︙ | ︙ |
Modified gtk3.xml from [bc08f78b0f] to [e0966116c5].
︙ | ︙ | |||
792 793 794 795 796 797 798 | </packing> </child> <child> <object class="GtkEntry" id="config_channel_order"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="invisible_char">●</property> | < | 792 793 794 795 796 797 798 799 800 801 802 803 804 805 | </packing> </child> <child> <object class="GtkEntry" id="config_channel_order"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="invisible_char">●</property> <property name="primary_icon_activatable">False</property> <property name="secondary_icon_activatable">False</property> </object> <packing> <property name="expand">True</property> <property name="fill">True</property> <property name="position">1</property> |
︙ | ︙ | |||
1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 | <property name="label" translatable="yes"><big><b>Configuration Settings</b></big></property> <property name="use_markup">True</property> </object> </child> </object> </child> </object> <object class="GtkDialog" id="search_dialog"> <property name="can_focus">False</property> <property name="opacity">0.95999999999999996</property> <property name="border_width">5</property> <property name="title" translatable="yes">station search</property> <property name="window_position">center-on-parent</property> <property name="type_hint">dialog</property> | > > > > > > > > > > | 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 | <property name="label" translatable="yes"><big><b>Configuration Settings</b></big></property> <property name="use_markup">True</property> </object> </child> </object> </child> </object> <object class="GtkImage" id="image1"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="stock">gtk-harddisk</property> </object> <object class="GtkImage" id="image2"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="stock">gtk-add</property> </object> <object class="GtkDialog" id="search_dialog"> <property name="can_focus">False</property> <property name="opacity">0.95999999999999996</property> <property name="border_width">5</property> <property name="title" translatable="yes">station search</property> <property name="window_position">center-on-parent</property> <property name="type_hint">dialog</property> |
︙ | ︙ | |||
1077 1078 1079 1080 1081 1082 1083 | <property name="spacing">2</property> <child internal-child="action_area"> <object class="GtkButtonBox" id="dialog-action_area1"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="layout_style">end</property> <child> | < < < < < < < | < < < < < < < < | < < < < < < < < < < < < < | < < < < < < < < < < < < < | < < < < < < < < < < < < < < < < | < < < < | 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 | <property name="spacing">2</property> <child internal-child="action_area"> <object class="GtkButtonBox" id="dialog-action_area1"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="layout_style">end</property> <child> <placeholder/> </child> <child> <placeholder/> </child> <child> <placeholder/> </child> <child> <placeholder/> </child> <child> <placeholder/> </child> </object> <packing> <property name="expand">False</property> <property name="fill">False</property> <property name="pack_type">end</property> <property name="position">0</property> |
︙ | ︙ | |||
1179 1180 1181 1182 1183 1184 1185 | <packing> <property name="expand">True</property> <property name="fill">True</property> <property name="position">0</property> </packing> </child> <child> | < < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 | <packing> <property name="expand">True</property> <property name="fill">True</property> <property name="position">0</property> </packing> </child> <child> <placeholder/> </child> <child> <object class="GtkHBox" id="hbox1"> <property name="visible">True</property> <property name="can_focus">False</property> <child> <object class="GtkLabel" id="label1"> |
︙ | ︙ | |||
2159 2160 2161 2162 2163 2164 2165 | <packing> <property name="expand">True</property> <property name="fill">True</property> <property name="position">2</property> </packing> </child> <child> | > > > > > > | < | < | | | > > > > | > > > | | | | | | > | | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 | <packing> <property name="expand">True</property> <property name="fill">True</property> <property name="position">2</property> </packing> </child> <child> <placeholder/> </child> <child> <placeholder/> </child> <child> <object class="GtkHBox" id="hbox3"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="spacing">20</property> <child> <object class="GtkButton" id="cache_search"> <property name="label" translatable="yes">Cache _find</property> <property name="visible">True</property> <property name="can_focus">False</property> <property name="can_default">True</property> <property name="has_default">True</property> <property name="receives_default">True</property> <property name="tooltip_text" translatable="yes">Start searching for above search term in the currently loaded station lists. Doesn't find *new* information, just looks through the known data.</property> <property name="image">image1</property> <property name="relief">half</property> <property name="use_underline">True</property> <signal name="clicked" handler="search_go" swapped="no"/> <accelerator key="Return" signal="activate"/> </object> <packing> <property name="expand">True</property> <property name="fill">True</property> <property name="position">0</property> </packing> </child> <child> <object class="GtkButton" id="server_search"> <property name="label" translatable="yes">Server _search</property> <property name="visible">True</property> <property name="can_focus">False</property> <property name="receives_default">True</property> <property name="tooltip_text" translatable="yes">Instead of doing a cache search, go through the search functions on the directory service homepages. (UNIMPLEMENTED)</property> <property name="image">image2</property> <property name="use_underline">True</property> <signal name="clicked" handler="search_srv" swapped="no"/> </object> <packing> <property name="expand">True</property> <property name="fill">True</property> <property name="position">1</property> </packing> </child> </object> <packing> <property name="expand">True</property> <property name="fill">True</property> <property name="position">5</property> </packing> </child> </object> <packing> <property name="expand">True</property> <property name="fill">True</property> <property name="position">1</property> </packing> </child> </object> </child> </object> <object class="GtkMenu" id="streamactions"> <property name="visible">True</property> <property name="can_focus">False</property> <child> <object class="GtkMenuItem" id="streamactions_play"> <property name="visible">True</property> |
︙ | ︙ |
Modified st2.py from [02ec24050c] to [f68e153942].
︙ | ︙ | |||
213 214 215 216 217 218 219 | "menu_projhomepage": lambda w: action.browser("http://milki.include-once.org/streamtuner2/"), # "menu_bugreport": lambda w: BugReport(), "menu_copy": self.menu_copy, "delete_entry": self.delete_entry, # search dialog "quicksearch_set": search.quicksearch_set, "search_open": search.menu_search, | | | < | 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 | "menu_projhomepage": lambda w: action.browser("http://milki.include-once.org/streamtuner2/"), # "menu_bugreport": lambda w: BugReport(), "menu_copy": self.menu_copy, "delete_entry": self.delete_entry, # search dialog "quicksearch_set": search.quicksearch_set, "search_open": search.menu_search, "search_go": search.cache_search, "search_srv": search.server_search, "search_cancel": search.cancel, "true": lambda w,*args: True, # win_streamedit "streamedit_open": streamedit.open, "streamedit_save": streamedit.save, "streamedit_new": streamedit.new, "streamedit_cancel": streamedit.cancel, |
︙ | ︙ | |||
591 592 593 594 595 596 597 | # hide dialog box again def cancel(self, *args): self.search_dialog.hide() return True # stop any other gtk handlers | | | | > < < < > > > > | | | | | < < < < < | < < | < > < | > > | > | | | | > > | > > > | > | | 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 | # hide dialog box again def cancel(self, *args): self.search_dialog.hide() return True # stop any other gtk handlers # prepare variables def prepare_search(self): main.status("Searching... Stand back.") self.cancel() self.q = self.search_full.get_text().lower() main.bookmarks.streams["search"] = [] # perform search def cache_search(self, *w): self.prepare_search() entries = [] # which fields? fields = ["title", "playing", "homepage"] #if not self.search_in_all.get_active(): # fields = [f for f in fields if (main.get_widget("search_in_"+f) and main.get_widget("search_in_"+f).get_active())] # channels? channels = main.channel_names[:] #if not self.search_channel_all.get_active(): # channels = [c for c in channels if main.get_widget("search_channel_"+c).get_active()] for c in channels: if main.channels[c] and main.channels[c].streams: # skip disabled plugins # categories for cat in main.channels[c].streams.keys(): # stations for row in main.channels[c].streams[cat]: # assemble text fields to compare text = " ".join([row.get(f, " ") for f in fields]) if text.lower().find(self.q) >= 0: row["genre"] = c + " " + row["genre"] entries.append(row) self.show_results(entries) # display "search" in "bookmarks" def show_results(self, entries): main.status(1.0) main.channel_switch(None, "bookmarks", 0) main.bookmarks.set_category("search") # insert data and show main.channels["bookmarks"].streams["search"] = entries # we have to set it here, else .currentcat() might reset it main.bookmarks.load("search") # live search on directory server homepages def server_search(self, w): self.prepare_search() entries = [] for i,cn in enumerate([main.channels[c] for c in main.channels]): # main.status(main, 1.0 * i / 15) if cn.has_search: __print__(dbg.PROC, "has_search:", cn.module) try: add = cn.update_streams(cat=None, search=self.q) for row in add: row["genre"] = cn.title + " " + row["genre"] entries += add except: continue self.show_results(entries) # search text edited in text entry box def quicksearch_set(self, w, *eat, **up): # keep query string main.q = self.search_quick.get_text().lower() |
︙ | ︙ | |||
955 956 957 958 959 960 961 | ] # content categories = ["favourite", ] # timer, links, search, and links show up as needed current = "favourite" default = "favourite" | | | 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 | ] # content categories = ["favourite", ] # timer, links, search, and links show up as needed current = "favourite" default = "favourite" streams = {"favourite":[], "search":[], "scripts":[], "timer":[], "history":[], } # cache list, to determine if a PLS url is bookmarked urls = [] # this channel does not actually retrieve/parse data from anywhere |
︙ | ︙ |