Add partial import functionality (#812)

This commit is contained in:
WithoutPants
2020-09-20 18:36:02 +10:00
committed by GitHub
parent 7a45943e8e
commit 8866670e53
56 changed files with 5030 additions and 624 deletions

View File

@@ -2,9 +2,10 @@ package models
import (
"database/sql/driver"
"time"
"github.com/stashapp/stash/pkg/logger"
"github.com/stashapp/stash/pkg/utils"
"time"
)
type SQLiteDate struct {
@@ -32,6 +33,11 @@ func (t *SQLiteDate) Scan(value interface{}) error {
// Value implements the driver Valuer interface.
func (t SQLiteDate) Value() (driver.Value, error) {
// handle empty string
if t.String == "" {
return "", nil
}
result, err := utils.ParseDateStringAsFormat(t.String, "2006-01-02")
if err != nil {
logger.Debugf("sqlite date conversion error: %s", err.Error())