mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 12:54:38 +03:00
Fix false positive mismatch in Movie Scrape dialog (#4144)
* Fix false positive mismatch in Movie Scrape dialog Scraping a movie by URL would show a difference in duration because the persisted value of duration was converted to HH:MM:SS while the newly scraped value was displayed without formatting: this makes sense because the newly scraped value is just a string and so could be anything This adds a check to see if the string is a number and converts it to HH:MM:SS format if possible * Fallback to original value if not a number --------- Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
@@ -84,7 +84,10 @@ export const MovieScrapeDialog: React.FC<IMovieScrapeDialogProps> = (
|
|||||||
const [duration, setDuration] = useState<ScrapeResult<string>>(
|
const [duration, setDuration] = useState<ScrapeResult<string>>(
|
||||||
new ScrapeResult<string>(
|
new ScrapeResult<string>(
|
||||||
DurationUtils.secondsToString(props.movie.duration || 0),
|
DurationUtils.secondsToString(props.movie.duration || 0),
|
||||||
props.scraped.duration
|
// convert seconds to string if it's a number
|
||||||
|
props.scraped.duration && !isNaN(+props.scraped.duration)
|
||||||
|
? DurationUtils.secondsToString(parseInt(props.scraped.duration, 10))
|
||||||
|
: props.scraped.duration
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
const [date, setDate] = useState<ScrapeResult<string>>(
|
const [date, setDate] = useState<ScrapeResult<string>>(
|
||||||
|
|||||||
Reference in New Issue
Block a user