mirror of https://github.com/stashapp/stash.git
Include scene o-counter in import/export (#488)
* Include o-counter in import/export * Fix scene card o-counter display
This commit is contained in:
parent
eee7adfb85
commit
ba09bfa64a
|
@ -40,6 +40,7 @@ type Scene struct {
|
|||
URL string `json:"url,omitempty"`
|
||||
Date string `json:"date,omitempty"`
|
||||
Rating int `json:"rating,omitempty"`
|
||||
OCounter int `json:"o_counter,omitempty"`
|
||||
Details string `json:"details,omitempty"`
|
||||
Gallery string `json:"gallery,omitempty"`
|
||||
Performers []string `json:"performers,omitempty"`
|
||||
|
|
|
@ -103,6 +103,9 @@ func (t *ExportTask) ExportScenes(ctx context.Context) {
|
|||
if scene.Rating.Valid {
|
||||
newSceneJSON.Rating = int(scene.Rating.Int64)
|
||||
}
|
||||
|
||||
newSceneJSON.OCounter = scene.OCounter
|
||||
|
||||
if scene.Details.Valid {
|
||||
newSceneJSON.Details = scene.Details.String
|
||||
}
|
||||
|
|
|
@ -489,6 +489,8 @@ func (t *ImportTask) ImportScenes(ctx context.Context) {
|
|||
if sceneJSON.Rating != 0 {
|
||||
newScene.Rating = sql.NullInt64{Int64: int64(sceneJSON.Rating), Valid: true}
|
||||
}
|
||||
|
||||
newScene.OCounter = sceneJSON.OCounter
|
||||
newScene.CreatedAt = models.SQLiteTimestamp{Timestamp: t.getTimeFromJSONTime(sceneJSON.CreatedAt)}
|
||||
newScene.UpdatedAt = models.SQLiteTimestamp{Timestamp: t.getTimeFromJSONTime(sceneJSON.UpdatedAt)}
|
||||
|
||||
|
|
|
@ -49,10 +49,10 @@ func NewSceneQueryBuilder() SceneQueryBuilder {
|
|||
func (qb *SceneQueryBuilder) Create(newScene Scene, tx *sqlx.Tx) (*Scene, error) {
|
||||
ensureTx(tx)
|
||||
result, err := tx.NamedExec(
|
||||
`INSERT INTO scenes (checksum, path, title, details, url, date, rating, size, duration, video_codec,
|
||||
`INSERT INTO scenes (checksum, path, title, details, url, date, rating, o_counter, size, duration, video_codec,
|
||||
audio_codec, format, width, height, framerate, bitrate, studio_id, cover,
|
||||
created_at, updated_at)
|
||||
VALUES (:checksum, :path, :title, :details, :url, :date, :rating, :size, :duration, :video_codec,
|
||||
VALUES (:checksum, :path, :title, :details, :url, :date, :rating, :o_counter, :size, :duration, :video_codec,
|
||||
:audio_codec, :format, :width, :height, :framerate, :bitrate, :studio_id, :cover,
|
||||
:created_at, :updated_at)
|
||||
`,
|
||||
|
|
|
@ -182,7 +182,7 @@ export const SceneCard: React.FC<ISceneCardProps> = (
|
|||
return (
|
||||
<div>
|
||||
<Button className="minimal">
|
||||
<SweatDrops />
|
||||
<span className="fa-icon"><SweatDrops /></span>
|
||||
<span>{props.scene.o_counter}</span>
|
||||
</Button>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue