From 509d852c09d2ae12d4795d98b24953e516e12932 Mon Sep 17 00:00:00 2001 From: Markus Ehrnsperger <> Date: Thu, 23 Nov 2023 19:53:52 +0100 Subject: [PATCH] dump_duplicates --- Makefile | 2 +- epgsearch.cpp | 4 +- live/css/styles.css | 4 + pages/ibox.ecpp | 23 - pages/login.ecpp | 2 +- pages/menu.ecpp | 26 +- pages/multischedule.ecpp | 2 +- pages/pageelems.ecpp | 26 +- pages/recordings.ecpp | 24 +- pages/searchtimers.ecpp | 10 +- pages/timerconflicts.ecpp | 12 +- pages/timers.ecpp | 8 +- pages/users.ecpp | 4 +- recman.cpp | 5 +- timers.cpp | 2 +- tools.cpp | 38 +- tools.h | 5 +- xxh3.h | 55 + xxhash.cpp | 42 + xxhash.h | 7048 +++++++++++++++++++++++++++++++++++++ 20 files changed, 7252 insertions(+), 90 deletions(-) create mode 100644 xxh3.h create mode 100644 xxhash.cpp create mode 100644 xxhash.h diff --git a/Makefile b/Makefile index 44232f02..3ddbd00c 100644 --- a/Makefile +++ b/Makefile @@ -92,7 +92,7 @@ VERSIONSUFFIX = gen_version_suffix.h PLUGINOBJS := $(PLUGIN).o thread.o tntconfig.o setup.o i18n.o timers.o \ tools.o recman.o tasks.o status.o epg_events.o epgsearch.o \ grab.o md5.o filecache.o livefeatures.o preload.o timerconflict.o \ - users.o osd_status.o ffmpeg.o StringMatch.o largeString.o + users.o osd_status.o ffmpeg.o StringMatch.o largeString.o xxhash.o PLUGINSRCS := $(patsubst %.o,%.cpp,$(PLUGINOBJS)) WEB_LIB_PAGES := libpages.a diff --git a/epgsearch.cpp b/epgsearch.cpp index 8ae12e23..06d50bef 100644 --- a/epgsearch.cpp +++ b/epgsearch.cpp @@ -617,7 +617,7 @@ void SearchResults::GetByQuery(std::string const& query) std::string SearchResults::AddQuery(std::string const& query) { querySet.insert(query); - return MD5Hash(query); + return xxHash128(query); } std::string SearchResults::PopQuery(std::string const& md5) @@ -628,7 +628,7 @@ std::string SearchResults::PopQuery(std::string const& md5) std::set::iterator it; for (it = querySet.begin(); it != querySet.end(); it++) { - if (md5 == MD5Hash(*it)) + if (md5 == xxHash128(*it)) { query = *it; querySet.erase(it); diff --git a/live/css/styles.css b/live/css/styles.css index 708be3e9..530915ee 100644 --- a/live/css/styles.css +++ b/live/css/styles.css @@ -1430,6 +1430,10 @@ img.thumb { .display-xs { display: none; } @media (max-width: 600px) { /* very small display */ +img.logo { width: 70px; margin-top: 25px; margin-right: 5px; } +div.__progress { width: 75px; } +div.__progress_invisible { width: 75px; } +div#infobox { min-width: 280px; } .xs-nomargin { margin: 0px !important; } .hidden-xs { display: none; } .td-hidden-xs { width: 0px !important; padding: 0px !important;} diff --git a/pages/ibox.ecpp b/pages/ibox.ecpp index 8277adb4..15a08c0a 100644 --- a/pages/ibox.ecpp +++ b/pages/ibox.ecpp @@ -44,13 +44,9 @@ TimerConflictNotifier timerNotifier(); if (NowReplaying) { RecordingsManagerPtr recManager = LiveRecordingsManager(); -#if VDRVERSNUM >= 20301 // is is OK to lock here, because CreateEpgInfo will *not* lock other lists LOCK_RECORDINGS_READ; cRecording *recording = (cRecording *)Recordings->GetByName(NowReplaying); -#else - cRecording *recording = Recordings.GetByName(NowReplaying); -#endif if (recording) { epgEvent = EpgEvents::CreateEpgInfo(recManager->Md5Hash(recording), recording, @@ -59,40 +55,21 @@ TimerConflictNotifier timerNotifier(); } else { std::string CHANNEL_STR("channel"); -#if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; -#else - ReadLock channelsLock( Channels ); -#endif if (cDevice::CurrentChannel()) { const int SKIP_GAP = 1; -#if VDRVERSNUM >= 20301 cChannel* Channel = (cChannel *)Channels->GetByNumber(cDevice::CurrentChannel()); cChannel* tmp = (cChannel *)Channels->GetByNumber(Channels->GetPrevNormal(cDevice::CurrentChannel()), -SKIP_GAP); -#else - cChannel* Channel = Channels.GetByNumber(cDevice::CurrentChannel()); - - cChannel* tmp = Channels.GetByNumber(Channels.GetPrevNormal(cDevice::CurrentChannel()), -SKIP_GAP); -#endif if (tmp && cDevice::PrimaryDevice() && cDevice::PrimaryDevice()->HasDecoder() ) prev_chan = tmp->GetChannelID(); -#if VDRVERSNUM >= 20301 tmp = (cChannel *)Channels->GetByNumber(Channels->GetNextNormal(cDevice::CurrentChannel()), SKIP_GAP); -#else - tmp = Channels.GetByNumber(Channels.GetNextNormal(cDevice::CurrentChannel()), SKIP_GAP); -#endif if (tmp && cDevice::PrimaryDevice() && cDevice::PrimaryDevice()->HasDecoder() ) next_chan = tmp->GetChannelID(); const std::string chanName(Channel->Name()); -#if VDRVERSNUM >= 20301 LOCK_SCHEDULES_READ; -#else - cSchedulesLock schedulesLock; - const cSchedules* Schedules = cSchedules::Schedules(schedulesLock); -#endif const cSchedule *Schedule = Schedules->GetSchedule(Channel); if (Schedule) { diff --git a/pages/login.ecpp b/pages/login.ecpp index 28ae2c62..52ea65b3 100644 --- a/pages/login.ecpp +++ b/pages/login.ecpp @@ -47,7 +47,7 @@ if (logged_in || !LiveSetup().UseAuth()) return reply.redirect(LiveSetup().GetSt
<$ tr("VDR Live Login") $>
- " alt="VDR Live"> + " alt="VDR Live" />
diff --git a/pages/menu.ecpp b/pages/menu.ecpp index 58472591..44fff61f 100644 --- a/pages/menu.ecpp +++ b/pages/menu.ecpp @@ -33,36 +33,36 @@ if (!component.empty()) { + " alt="" <& tooltip.hint text=(tr("Search for repeats.")) &> /> <%cpp> } } <%cpp> if (LiveSetup().GetShowPlayMediaplayer() ) { @@ -1032,8 +1032,7 @@ if (scraperMovieOrTv.found) { % } <%cpp> @@ -1096,8 +1095,7 @@ const std::vector *media_v = static_cast *>((voi for (const cTvMedia &media: *media_v) { - - + <%cpp> } diff --git a/pages/recordings.ecpp b/pages/recordings.ecpp index d8270bcf..70aab67d 100644 --- a/pages/recordings.ecpp +++ b/pages/recordings.ecpp @@ -460,13 +460,14 @@ if (currentFlat != "true") { // do we have to get/write the recording details? // we have to, if currentFlat == true || level == 0 || this folder is open (cookie) bool write_recs = level == 0 || currentFlat == "true"; -if (!write_recs) { +if (!write_recs && recItemsC) { // check: is this folder open (cookie)? auto equal_fldf = [parentIdHash](cSv f) { return f.compare(5, std::string_view::npos, parentIdHash) == 0; }; cSplit splitOpenTreeNodes(openTreeNodes, ','); write_recs = std::find_if(splitOpenTreeNodes.begin(), splitOpenTreeNodes.end(), equal_fldf) != splitOpenTreeNodes.end(); } -if (write_recs) { +if (write_recs && recItemsC) { +// in case of duplicates, and not flat, the recItemsC is not available char buffer_i[21]; buffer_i[20] = 0; @@ -519,6 +520,25 @@ if (currentSort != "duplicates" || currentFlat == "true") { } if (!recItems.empty() ) { std::string idHash(xxHash32(nodeName)); +// do we have to get/write the recording details? +// check: is this folder open (cookie)? + auto equal_fldf = [idHash](cSv f) { return f.compare(5, std::string_view::npos, idHash) == 0; }; + cSplit splitOpenTreeNodes(openTreeNodes, ','); + if (std::find_if(splitOpenTreeNodes.begin(), splitOpenTreeNodes.end(), equal_fldf) != splitOpenTreeNodes.end()) { + char buffer_i[21]; + buffer_i[20] = 0; + + + <%cpp> + } bool first = true; recoring_item->clear(); RecordingsItemRec::AppendAsJSArray(*recoring_item, recItems.begin(), recItems.end(), first, currentFilter, false); diff --git a/pages/searchtimers.ecpp b/pages/searchtimers.ecpp index d5227216..15342c63 100644 --- a/pages/searchtimers.ecpp +++ b/pages/searchtimers.ecpp @@ -72,14 +72,14 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); - + - - - - + + + + <%cpp> } diff --git a/pages/timerconflicts.ecpp b/pages/timerconflicts.ecpp index adc72d0a..70b78e36 100644 --- a/pages/timerconflicts.ecpp +++ b/pages/timerconflicts.ecpp @@ -124,7 +124,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); AppendHtmlEscapedAndCorrectNonUTF8(timerFile, timer->File()); - +