memcpy(b, &tmp, sizeof(tmp));
return 0;
}
+
+/* Validate hex string */
+int
+uuid_hexvalid ( const char *uuid )
+{
+ int i;
+ if (uuid == NULL)
+ return 0;
+ for (i = 0; i < UUID_HEX_SIZE - 1; i++)
+ if (hexnibble(uuid[i]) < 0)
+ return 0;
+ return 1;
+}
*/
int uuid_hex2bin ( const tvh_uuid_t *a, tvh_uuid_t *b );
+/**
+ * Valid hex uuid
+ */
+int uuid_hexvalid ( const char *uuid );
+
/**
* Hex string to binary
*/
de = dvr_entry_find_by_id(atoi(components[1]));
else if(nc == 2 && !strcmp(components[0], "tagid"))
tag = channel_tag_find_by_identifier(atoi(components[1]));
- else if(nc == 2 && !strcmp(components[0], "tag"))
+ else if(nc == 2 && !strcmp(components[0], "tagname"))
tag = channel_tag_find_by_name(components[1], 0);
+ else if(nc == 2 && !strcmp(components[0], "tag")) {
+ if (uuid_hexvalid(components[1]))
+ tag = channel_tag_find_by_uuid(components[1]);
+ else
+ tag = channel_tag_find_by_name(components[1], 0);
+ }
if(ch)
r = http_channel_playlist(hc, pltype, ch);
pthread_mutex_lock(&global_lock);
- if (nc == 2 && !strcmp(components[0], "channeluuid"))
- ch = channel_find_by_uuid(components[1]);
+ if (nc == 2 && !strcmp(components[0], "channelid"))
+ ch = channel_find_by_id(atoi(components[1]));
else if (nc == 2 && !strcmp(components[0], "channelnumber"))
ch = channel_find_by_number(components[1]);
else if (nc == 2 && !strcmp(components[0], "channelname"))
ch = channel_find(components[1]);
else if (nc == 2 && !strcmp(components[0], "tagid"))
tag = channel_tag_find_by_identifier(atoi(components[1]));
- else if (nc == 2 && !strcmp(components[0], "tag"))
+ else if (nc == 2 && !strcmp(components[0], "tagname"))
tag = channel_tag_find_by_name(components[1], 0);
+ else if (nc == 2 && !strcmp(components[0], "tag"))
+ tag = channel_tag_find_by_uuid(components[1]);
if (ch) {
r = http_xmltv_channel(hc, ch);