aboutsummaryrefslogtreecommitdiff
path: root/src/NetUtils.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-10-03 09:01:14 +0200
committerdec05eba <dec05eba@protonmail.com>2021-10-03 10:42:30 +0200
commitbe20a78ab01b924fc1261ff3c71361feb440e592 (patch)
treef4c54eac158ee92b5dca42d6967fa1b2b5135cde /src/NetUtils.cpp
parent522c6ea14cd2c1569ce5ff24c0241edba1835308 (diff)
xv: fix missing search results, incorrect title to thumbnail matches
Diffstat (limited to 'src/NetUtils.cpp')
-rw-r--r--src/NetUtils.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/NetUtils.cpp b/src/NetUtils.cpp
index 9cf88c7..4f5fce8 100644
--- a/src/NetUtils.cpp
+++ b/src/NetUtils.cpp
@@ -44,12 +44,23 @@ namespace QuickMedia {
index += 2;
size_t end_index = str.find(';', index);
if(end_index != std::string::npos && end_index - index <= 3) {
- const size_t num_length = end_index - index;
- int num;
- if(to_num(str.c_str() + index, num_length, num)) {
- const char num_c = (char)num;
- str.replace(index - 2, 2 + num_length + 1, &num_c, 1);
- index += (-2 + 1);
+ if(str[index] == 'x') {
+ ++index;
+ const size_t num_length = end_index - index;
+ int num;
+ if(to_num_hex(str.c_str() + index, num_length, num)) {
+ const char num_c = (char)num;
+ str.replace(index - 3, 3 + num_length + 1, &num_c, 1);
+ index += (-3 + 1);
+ }
+ } else {
+ const size_t num_length = end_index - index;
+ int num;
+ if(to_num(str.c_str() + index, num_length, num)) {
+ const char num_c = (char)num;
+ str.replace(index - 2, 2 + num_length + 1, &num_c, 1);
+ index += (-2 + 1);
+ }
}
}
}