mirror of
https://github.com/stashapp/stash.git
synced 2026-05-08 20:58:48 +02: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:
parent
9577600804
commit
165528f7b6
1 changed files with 4 additions and 1 deletions
|
|
@ -84,7 +84,10 @@ export const MovieScrapeDialog: React.FC<IMovieScrapeDialogProps> = (
|
|||
const [duration, setDuration] = useState<ScrapeResult<string>>(
|
||||
new ScrapeResult<string>(
|
||||
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>>(
|
||||
|
|
|
|||
Loading…
Reference in a new issue