From be20a78ab01b924fc1261ff3c71361feb440e592 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 3 Oct 2021 09:01:14 +0200 Subject: xv: fix missing search results, incorrect title to thumbnail matches --- src/NetUtils.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'src/NetUtils.cpp') 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); + } } } } -- cgit v1.2.3