Skip to content

Commit f290caa

Browse files
Release 1.1.0
1 parent 1a6b45a commit f290caa

1 file changed

Lines changed: 24 additions & 5 deletions

File tree

HDEncode-Search-Plus.user.js

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ==UserScript==
22
// @name HD-Encode Search+
33
// @namespace https://hdencode.org/
4-
// @version 1.0.9
4+
// @version 1.1.0
55
// @description Filtering, advanced sorting, live custom search, custom pagination, category switching, quick links, NFO panel, settings, presets, bulk copy, and sticky UI for HDEncode.org
66
// @author xXSalamanderXx
77
// @homepage https://github.com/xXSalamanderXx/HDEncode-Search-Plus/
@@ -147,7 +147,7 @@
147147
/* Remove default spin buttons for a cleaner look on numbers */
148148
#${SCRIPT_ID}-bar input[type=number]::-webkit-inner-spin-button,
149149
#${SCRIPT_ID}-bar input[type=number]::-webkit-outer-spin-button {
150-
opacity: 0.5; /* Keeping them visible but less intrusive */
150+
opacity: 0.5;
151151
}
152152
153153
#f-progress-bar { width: 0%; transition: width 0.3s ease-out; }
@@ -398,10 +398,29 @@
398398
const h5 = item.querySelector('h5 a');
399399
if (!h5) return '';
400400
let text = h5.textContent || h5.innerText;
401-
text = text.replace(/\[.*?\]/g, '');
402-
text = text.replace(/\(\d{4}\)/g, '');
401+
402+
// Strip bracketed tags, parenthesis years (temporarily) and sizes
403+
text = text.replace(/\[.*?\]/g, ' ');
404+
text = text.replace(/\(\d{4}\)/g, (match) => match.replace(/[()]/g, ''));
403405
text = text.replace(/[-]\s*[\d.]+\s*(GB|MB).*$/i, '');
404-
return text.trim();
406+
407+
// Cut off exactly at the scene release tags to remove the clutter
408+
const sceneCutoff = /\b(1080p|720p|2160p|480p|4k|uhd|web-dl|webrip|bluray|bdrip|brrip|hdtv|x264|x265|hevc|ddp\d|aac|ac3|dts|remux)\b.*/i;
409+
text = text.replace(sceneCutoff, '');
410+
411+
// Replace all dots and underscores with spaces
412+
text = text.replace(/[._]/g, ' ');
413+
414+
// Clean up extra spaces and trailing hyphens
415+
text = text.replace(/\s+/g, ' ').replace(/\s-\s*$/, '').trim();
416+
417+
// Apply clean Title Case formatting
418+
text = text.split(' ').map(word => {
419+
if (word.match(/^s\d{2}e\d{2}$/i)) return word.toUpperCase(); // Preserve formatting for S01E01
420+
return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
421+
}).join(' ');
422+
423+
return text;
405424
}
406425

407426
function hasDV(item) {

0 commit comments

Comments
 (0)