mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
@@ -46,6 +46,10 @@ Once you have a certificate and key file name them `stash.crt` and `stash.key` a
|
|||||||
|
|
||||||
# FAQ
|
# FAQ
|
||||||
|
|
||||||
|
> I'm unable to run the app on OSX or Linux
|
||||||
|
|
||||||
|
Try running `chmod u+x stash-osx` or `chmod u+x stash-linux` to make the file executable.
|
||||||
|
|
||||||
> I have a question not answered here.
|
> I have a question not answered here.
|
||||||
|
|
||||||
Join the [Discord server](https://discord.gg/2TsNFKt).
|
Join the [Discord server](https://discord.gg/2TsNFKt).
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -117,10 +117,7 @@ func (r *queryResolver) SceneMarkerTags(ctx context.Context, scene_id string) ([
|
|||||||
var keys []int
|
var keys []int
|
||||||
tqb := models.NewTagQueryBuilder()
|
tqb := models.NewTagQueryBuilder()
|
||||||
for _, sceneMarker := range sceneMarkers {
|
for _, sceneMarker := range sceneMarkers {
|
||||||
if !sceneMarker.PrimaryTagID.Valid {
|
markerPrimaryTag, err := tqb.Find(sceneMarker.PrimaryTagID, nil)
|
||||||
panic("missing primary tag id")
|
|
||||||
}
|
|
||||||
markerPrimaryTag, err := tqb.Find(int(sceneMarker.PrimaryTagID.Int64), nil)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,10 +18,7 @@ func (r *sceneMarkerResolver) Scene(ctx context.Context, obj *models.SceneMarker
|
|||||||
|
|
||||||
func (r *sceneMarkerResolver) PrimaryTag(ctx context.Context, obj *models.SceneMarker) (*models.Tag, error) {
|
func (r *sceneMarkerResolver) PrimaryTag(ctx context.Context, obj *models.SceneMarker) (*models.Tag, error) {
|
||||||
qb := models.NewTagQueryBuilder()
|
qb := models.NewTagQueryBuilder()
|
||||||
if !obj.PrimaryTagID.Valid {
|
tag, err := qb.Find(obj.PrimaryTagID, nil)
|
||||||
panic("TODO no primary tag id")
|
|
||||||
}
|
|
||||||
tag, err := qb.Find(int(obj.PrimaryTagID.Int64), nil) // TODO make primary tag id not null in DB
|
|
||||||
return tag, err
|
return tag, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ func (r *mutationResolver) SceneMarkerCreate(ctx context.Context, input models.S
|
|||||||
newSceneMarker := models.SceneMarker{
|
newSceneMarker := models.SceneMarker{
|
||||||
Title: input.Title,
|
Title: input.Title,
|
||||||
Seconds: input.Seconds,
|
Seconds: input.Seconds,
|
||||||
PrimaryTagID: sql.NullInt64{Int64: int64(primaryTagID), Valid: primaryTagID != 0},
|
PrimaryTagID: primaryTagID,
|
||||||
SceneID: sql.NullInt64{Int64: int64(sceneID), Valid: sceneID != 0},
|
SceneID: sql.NullInt64{Int64: int64(sceneID), Valid: sceneID != 0},
|
||||||
CreatedAt: models.SQLiteTimestamp{Timestamp: currentTime},
|
CreatedAt: models.SQLiteTimestamp{Timestamp: currentTime},
|
||||||
UpdatedAt: models.SQLiteTimestamp{Timestamp: currentTime},
|
UpdatedAt: models.SQLiteTimestamp{Timestamp: currentTime},
|
||||||
@@ -127,7 +127,7 @@ func (r *mutationResolver) SceneMarkerUpdate(ctx context.Context, input models.S
|
|||||||
Title: input.Title,
|
Title: input.Title,
|
||||||
Seconds: input.Seconds,
|
Seconds: input.Seconds,
|
||||||
SceneID: sql.NullInt64{Int64: int64(sceneID), Valid: sceneID != 0},
|
SceneID: sql.NullInt64{Int64: int64(sceneID), Valid: sceneID != 0},
|
||||||
PrimaryTagID: sql.NullInt64{Int64: int64(primaryTagID), Valid: primaryTagID != 0},
|
PrimaryTagID: primaryTagID,
|
||||||
UpdatedAt: models.SQLiteTimestamp{Timestamp: time.Now()},
|
UpdatedAt: models.SQLiteTimestamp{Timestamp: time.Now()},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,7 +170,7 @@ func changeMarker(ctx context.Context, changeType int, changedMarker models.Scen
|
|||||||
var markerTagJoins []models.SceneMarkersTags
|
var markerTagJoins []models.SceneMarkersTags
|
||||||
for _, tid := range tagIds {
|
for _, tid := range tagIds {
|
||||||
tagID, _ := strconv.Atoi(tid)
|
tagID, _ := strconv.Atoi(tid)
|
||||||
if int64(tagID) == changedMarker.PrimaryTagID.Int64 {
|
if tagID == changedMarker.PrimaryTagID {
|
||||||
continue // If this tag is the primary tag, then let's not add it.
|
continue // If this tag is the primary tag, then let's not add it.
|
||||||
}
|
}
|
||||||
markerTag := models.SceneMarkersTags{
|
markerTag := models.SceneMarkersTags{
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ CREATE TABLE `scene_markers` (
|
|||||||
`id` integer not null primary key autoincrement,
|
`id` integer not null primary key autoincrement,
|
||||||
`title` varchar(255) not null,
|
`title` varchar(255) not null,
|
||||||
`seconds` float not null,
|
`seconds` float not null,
|
||||||
`primary_tag_id` integer,
|
`primary_tag_id` integer not null,
|
||||||
`scene_id` integer,
|
`scene_id` integer,
|
||||||
`created_at` datetime not null,
|
`created_at` datetime not null,
|
||||||
`updated_at` datetime not null,
|
`updated_at` datetime not null,
|
||||||
|
|||||||
@@ -109,11 +109,7 @@ func (t *ExportTask) ExportScenes(ctx context.Context) {
|
|||||||
newSceneJSON.Tags = t.getTagNames(tags)
|
newSceneJSON.Tags = t.getTagNames(tags)
|
||||||
|
|
||||||
for _, sceneMarker := range sceneMarkers {
|
for _, sceneMarker := range sceneMarkers {
|
||||||
var primaryTagID int
|
primaryTag, err := tagQB.Find(sceneMarker.PrimaryTagID, tx)
|
||||||
if sceneMarker.PrimaryTagID.Valid {
|
|
||||||
primaryTagID = int(sceneMarker.PrimaryTagID.Int64)
|
|
||||||
}
|
|
||||||
primaryTag, err := tagQB.Find(primaryTagID, tx)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Errorf("[scenes] <%s> invalid primary tag for scene marker: %s", scene.Checksum, err.Error())
|
logger.Errorf("[scenes] <%s> invalid primary tag for scene marker: %s", scene.Checksum, err.Error())
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -519,7 +519,7 @@ func (t *ImportTask) ImportScenes(ctx context.Context) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Errorf("[scenes] <%s> failed to find primary tag for marker: %s", scene.Checksum, err.Error())
|
logger.Errorf("[scenes] <%s> failed to find primary tag for marker: %s", scene.Checksum, err.Error())
|
||||||
} else {
|
} else {
|
||||||
newSceneMarker.PrimaryTagID = sql.NullInt64{Int64: int64(primaryTag.ID), Valid: true}
|
newSceneMarker.PrimaryTagID = primaryTag.ID
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the scene marker in the DB
|
// Create the scene marker in the DB
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ type SceneMarker struct {
|
|||||||
ID int `db:"id" json:"id"`
|
ID int `db:"id" json:"id"`
|
||||||
Title string `db:"title" json:"title"`
|
Title string `db:"title" json:"title"`
|
||||||
Seconds float64 `db:"seconds" json:"seconds"`
|
Seconds float64 `db:"seconds" json:"seconds"`
|
||||||
PrimaryTagID sql.NullInt64 `db:"primary_tag_id,omitempty" json:"primary_tag_id"`
|
PrimaryTagID int `db:"primary_tag_id" json:"primary_tag_id"`
|
||||||
SceneID sql.NullInt64 `db:"scene_id,omitempty" json:"scene_id"`
|
SceneID sql.NullInt64 `db:"scene_id,omitempty" json:"scene_id"`
|
||||||
CreatedAt SQLiteTimestamp `db:"created_at" json:"created_at"`
|
CreatedAt SQLiteTimestamp `db:"created_at" json:"created_at"`
|
||||||
UpdatedAt SQLiteTimestamp `db:"updated_at" json:"updated_at"`
|
UpdatedAt SQLiteTimestamp `db:"updated_at" json:"updated_at"`
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import { FilterSelect } from "../../select/FilterSelect";
|
|||||||
import { MarkerTitleSuggest } from "../../select/MarkerTitleSuggest";
|
import { MarkerTitleSuggest } from "../../select/MarkerTitleSuggest";
|
||||||
import { WallPanel } from "../../Wall/WallPanel";
|
import { WallPanel } from "../../Wall/WallPanel";
|
||||||
import { SceneHelpers } from "../helpers";
|
import { SceneHelpers } from "../helpers";
|
||||||
|
import { ErrorUtils } from "../../../utils/errors";
|
||||||
|
|
||||||
interface ISceneMarkersPanelProps {
|
interface ISceneMarkersPanelProps {
|
||||||
scene: GQL.SceneDataFragment;
|
scene: GQL.SceneDataFragment;
|
||||||
@@ -113,17 +114,17 @@ export const SceneMarkersPanel: FunctionComponent<ISceneMarkersPanelProps> = (pr
|
|||||||
};
|
};
|
||||||
if (!isEditing) {
|
if (!isEditing) {
|
||||||
sceneMarkerCreate({ variables }).then((response) => {
|
sceneMarkerCreate({ variables }).then((response) => {
|
||||||
console.log(response);
|
setIsEditorOpen(false);
|
||||||
}).catch((err) => console.error(err));
|
setEditingMarker(null);
|
||||||
|
}).catch((err) => ErrorUtils.handleApolloError(err));
|
||||||
} else {
|
} else {
|
||||||
const updateVariables = variables as GQL.SceneMarkerUpdateVariables;
|
const updateVariables = variables as GQL.SceneMarkerUpdateVariables;
|
||||||
updateVariables.id = editingMarker!.id;
|
updateVariables.id = editingMarker!.id;
|
||||||
sceneMarkerUpdate({ variables: updateVariables }).then((response) => {
|
sceneMarkerUpdate({ variables: updateVariables }).then((response) => {
|
||||||
console.log(response);
|
setIsEditorOpen(false);
|
||||||
}).catch((err) => console.error(err));
|
setEditingMarker(null);
|
||||||
|
}).catch((err) => ErrorUtils.handleApolloError(err));
|
||||||
}
|
}
|
||||||
setIsEditorOpen(false);
|
|
||||||
setEditingMarker(null);
|
|
||||||
}
|
}
|
||||||
function onDelete() {
|
function onDelete() {
|
||||||
if (!editingMarker) { return; }
|
if (!editingMarker) { return; }
|
||||||
|
|||||||
Reference in New Issue
Block a user