mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Fix scraper date parser failing when parsing time (#1431)
* Don't mutate the original scraped date `time.Parse` is case-sensitive for some values, `AM/pm` in particular
This commit is contained in:
@@ -368,10 +368,10 @@ func (p *postProcessParseDate) Apply(value string, q mappedQuery) string {
|
|||||||
|
|
||||||
const internalDateFormat = "2006-01-02"
|
const internalDateFormat = "2006-01-02"
|
||||||
|
|
||||||
value = strings.ToLower(value)
|
valueLower := strings.ToLower(value)
|
||||||
if value == "today" || value == "yesterday" { // handle today, yesterday
|
if valueLower == "today" || valueLower == "yesterday" { // handle today, yesterday
|
||||||
dt := time.Now()
|
dt := time.Now()
|
||||||
if value == "yesterday" { // subtract 1 day from now
|
if valueLower == "yesterday" { // subtract 1 day from now
|
||||||
dt = dt.AddDate(0, 0, -1)
|
dt = dt.AddDate(0, 0, -1)
|
||||||
}
|
}
|
||||||
return dt.Format(internalDateFormat)
|
return dt.Format(internalDateFormat)
|
||||||
|
|||||||
@@ -12,5 +12,6 @@
|
|||||||
* Add button to remove studio stash ID. ([#1378](https://github.com/stashapp/stash/pull/1378))
|
* Add button to remove studio stash ID. ([#1378](https://github.com/stashapp/stash/pull/1378))
|
||||||
|
|
||||||
### 🐛 Bug fixes
|
### 🐛 Bug fixes
|
||||||
|
* Fix scraper date parser failing when parsing time. ([#1431](https://github.com/stashapp/stash/pull/1431))
|
||||||
* Fix quotes in filter labels causing UI errors. ([#1425](https://github.com/stashapp/stash/pull/1425))
|
* Fix quotes in filter labels causing UI errors. ([#1425](https://github.com/stashapp/stash/pull/1425))
|
||||||
* Fix post-processing not running when scraping by performer fragment. ([#1387](https://github.com/stashapp/stash/pull/1387))
|
* Fix post-processing not running when scraping by performer fragment. ([#1387](https://github.com/stashapp/stash/pull/1387))
|
||||||
|
|||||||
Reference in New Issue
Block a user