mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
SQLite model refactoring (#3791)
* Remove ID from PerformerPartial * Separate studio model from sqlite model * Separate movie model from sqlite model * Separate tag model from sqlite model * Separate saved filter model from sqlite model * Separate scene marker model from sqlite model * Separate gallery chapter model from sqlite model * Move ErrNoRows checks into sqlite, improve empty result error messages * Move SQLiteDate and SQLiteTimestamp to sqlite * Use changesetTranslator everywhere, refactor for consistency * Make PerformerStore.DestroyImage private * Fix rating on movie create
This commit is contained in:
@@ -7,19 +7,6 @@ import (
|
||||
|
||||
const railsTimeLayout = "2006-01-02 15:04:05 MST"
|
||||
|
||||
func GetYMDFromDatabaseDate(dateString string) string {
|
||||
result, _ := ParseDateStringAsFormat(dateString, "2006-01-02")
|
||||
return result
|
||||
}
|
||||
|
||||
func ParseDateStringAsFormat(dateString string, format string) (string, error) {
|
||||
t, e := ParseDateStringAsTime(dateString)
|
||||
if e == nil {
|
||||
return t.Format(format), e
|
||||
}
|
||||
return "", fmt.Errorf("ParseDateStringAsFormat failed: dateString <%s>, format <%s>", dateString, format)
|
||||
}
|
||||
|
||||
func ParseDateStringAsTime(dateString string) (time.Time, error) {
|
||||
// https://stackoverflow.com/a/20234207 WTF?
|
||||
|
||||
|
||||
Reference in New Issue
Block a user