@@ -149,41 +149,26 @@ rule_check_item_has_enc (rulePtr rule, itemPtr item)
149149 return item -> hasEnclosure ;
150150}
151151
152- static void
153- rule_check_item_has_podcast_metadata_cb ( const gchar * key , const gchar * value ,
154- guint index , gpointer user_data )
155- {
156- gboolean * found = (gboolean * ) user_data ;
157- if (* found ) {
158- return ; /* Already found, nothing else to do. */
159- }
160- if (g_strcmp0 (key , "enclosure" ) != 0 ) {
161- return ;
162- }
163- enclosurePtr encl = enclosure_from_string (value );
164- if (encl != NULL ) {
165- if (encl -> mime && g_str_has_prefix (encl -> mime , "audio/" )) {
166- * found = TRUE;
167- }
168- enclosure_free (encl );
169- }
170- }
171-
172152static gboolean
173153rule_check_item_has_podcast (rulePtr rule , itemPtr item )
174154{
175- if (!item -> hasEnclosure ) {
176- return FALSE; /* Optimization. */
177- }
178-
155+ GSList * iter = metadata_list_get_values (item -> metadata , "enclosure" );
179156 gboolean found = FALSE;
180- metadata_list_foreach (item -> metadata ,
181- rule_check_item_has_podcast_metadata_cb ,
182- & found );
157+ enclosurePtr encl ;
158+
159+ while (iter && !found ) {
160+ enclosurePtr encl = enclosure_from_string ((gchar * )iter -> data );
161+ if (encl != NULL ) {
162+ if (encl -> mime && g_str_has_prefix (encl -> mime , "audio/" )) {
163+ found = TRUE;
164+ }
165+ enclosure_free (encl );
166+ }
167+ iter = g_slist_next (iter );
168+ }
183169 return found ;
184170}
185171
186-
187172static gboolean
188173rule_check_item_category (rulePtr rule , itemPtr item )
189174{
0 commit comments