From 8b3f0e911b5a296e664171c6135e674a4f101840 Mon Sep 17 00:00:00 2001 From: Matt Goldspink Date: Thu, 16 Jun 2022 21:07:31 -0700 Subject: Tracks that last longer than an hour don't show that. I've fixed up the formatSeconds to test if it's longer than an hour then show the extra portion. --- src/web/src/lib/util.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/web/src/lib/util.js b/src/web/src/lib/util.js index 94095efa..20653737 100644 --- a/src/web/src/lib/util.js +++ b/src/web/src/lib/util.js @@ -3,6 +3,9 @@ export const formatSeconds = (seconds) => if (isNaN(seconds)) return ''; var date = new Date(1970,0,1); date.setSeconds(seconds); + if (seconds >= 3600) { + return date.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, '$1'); + } return date.toTimeString().replace(/.*(\d{2}:\d{2}).*/, '$1'); }; -- cgit v1.2.3 From 39b3d1e16fd51b0b73321e8100b52614e293b47d Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 16 Jun 2022 23:32:18 -0500 Subject: add minbitdepth filter --- src/web/src/components/Search/Detail/SearchDetail.js | 2 +- src/web/src/lib/searches.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/web/src/components/Search/Detail/SearchDetail.js b/src/web/src/components/Search/Detail/SearchDetail.js index 4de3cc0e..af61c0ca 100644 --- a/src/web/src/components/Search/Detail/SearchDetail.js +++ b/src/web/src/components/Search/Detail/SearchDetail.js @@ -189,7 +189,7 @@ const SearchDetail = ({ search, creating, stopping, removing, disabled, onCreate className='search-filter' placeholder=' lackluster container -bothersome iscbr|isvbr islossless|islossy - minbitrate:320 minfilesize:10 minfilesinfolder:8 minlength:5000 + minbitrate:320 minbitdepth:24 minfilesize:10 minfilesinfolder:8 minlength:5000 ' label={{ icon: 'filter', content: 'Filter' }} value={resultFilters} diff --git a/src/web/src/lib/searches.js b/src/web/src/lib/searches.js index c7312bf5..a0e97820 100644 --- a/src/web/src/lib/searches.js +++ b/src/web/src/lib/searches.js @@ -34,6 +34,7 @@ export const getResponses = async ({ id }) => { export const parseFiltersFromString = (string) => { const filters = { minBitRate: 0, + minBitDepth: 0, minFileSize: 0, minLength: 0, minFilesInFolder: 0, @@ -54,6 +55,7 @@ export const parseFiltersFromString = (string) => { }; filters.minBitRate = getNthMatch(string, /(minbr|minbitrate):([0-9]+)/i, 2) || filters.minBitRate; + filters.minBitDepth = getNthMatch(string, /(minbd|minbitdepth):([0-9]+)/i, 2) || filters.minBitDepth; filters.minFileSize = getNthMatch(string, /(minfs|minfilesize):([0-9]+)/i, 2) || filters.minFileSize; filters.minLength = getNthMatch(string, /(minlen|minlength):([0-9]+)/i, 2) || filters.minLength; filters.minFilesInFolder = getNthMatch(string, /(minfif|minfilesinfolder):([0-9]+)/i, 2) || filters.minFilesInFolder; @@ -76,6 +78,7 @@ export const parseFiltersFromString = (string) => { export const filterResponse = ({ filters = { minBitRate: 0, + minBitDepth: 0, minFileSize: 0, minLength: 0, include: [], @@ -100,7 +103,7 @@ export const filterResponse = ({ const { bitRate, size, length, filename, sampleRate, bitDepth, isVariableBitRate } = file; const { isCBR, isVBR, isLossless, isLossy, - minBitRate, minFileSize, minLength, + minBitRate, minBitDepth, minFileSize, minLength, include = [], exclude = [], } = filters; @@ -109,6 +112,7 @@ export const filterResponse = ({ if (isLossless && (!sampleRate || !bitDepth)) return false; if (isLossy && (sampleRate || bitDepth)) return false; if (bitRate < minBitRate) return false; + if (bitDepth < minBitDepth) return false; if (size < minFileSize) return false; if (length < minLength) return false; -- cgit v1.2.3