Refresh marker panel on marker create (#2502)

* Update scene markers on create
* Improve display of markers without titles
* Fix marker title not populating
This commit is contained in:
WithoutPants
2022-04-21 11:33:04 +10:00
committed by GitHub
parent 340f47cda8
commit 9e606feb76
6 changed files with 21 additions and 7 deletions

View File

@@ -1,3 +1,4 @@
### 🐛 Bug fixes
* Fix markers not refreshing after creating new marker. ([#2502](https://github.com/stashapp/stash/pull/2502))
* Fix error when submitting scene draft to stash-box without performers. ([#2515](https://github.com/stashapp/stash/pull/2515))
* Fix incorrect video player positioning on touch-enabled devices. ([#2501](https://github.com/stashapp/stash/issues/2501))

View File

@@ -310,7 +310,7 @@ export const ScenePlayerScrubber: React.FC<IScenePlayerScrubberProps> = (
style={getTagStyle(index)}
{...dataAttrs}
>
{marker.title}
{marker.title || marker.primary_tag.name}
</div>
);
});

View File

@@ -382,6 +382,16 @@ export const MarkerTitleSuggest: React.FC<IMarkerSuggestProps> = (props) => {
value: item?.title ?? "",
}));
const initialIds = props.initialMarkerTitle ? [props.initialMarkerTitle] : [];
// add initial value to items if still loading, to ensure existing value
// is populated
if (loading && initialIds.length > 0) {
items.push({
label: initialIds[0],
value: initialIds[0],
});
}
return (
<SelectComponent
isMulti={false}

View File

@@ -51,9 +51,9 @@ export const TagLink: React.FC<IProps> = (props: IProps) => {
title = props.movie.name || "";
} else if (props.marker) {
link = NavUtils.makeSceneMarkerUrl(props.marker);
title = `${props.marker.title} - ${TextUtils.secondsToTimestamp(
props.marker.seconds || 0
)}`;
title = `${
props.marker.title || props.marker.primary_tag?.name || ""
} - ${TextUtils.secondsToTimestamp(props.marker.seconds || 0)}`;
} else if (props.gallery) {
link = `/galleries/${props.gallery.id}`;
title = props.gallery.title

View File

@@ -182,10 +182,12 @@ export const WallItem: React.FC<IWallItemProps> = (props: IWallItemProps) => {
const renderText = () => {
if (!showTextContainer) return;
const markerTitle = props.sceneMarker?.title;
const title = props.sceneMarker
? `${props.sceneMarker!.title} - ${TextUtils.secondsToTimestamp(
props.sceneMarker.seconds
)}`
? `${
markerTitle ? `${markerTitle} - ` : ""
}${TextUtils.secondsToTimestamp(props.sceneMarker.seconds)}`
: props.scene?.title ?? "";
const tags = props.sceneMarker
? [props.sceneMarker.primary_tag, ...props.sceneMarker.tags]

View File

@@ -251,6 +251,7 @@ const sceneMarkerMutationImpactedQueries = [
GQL.FindScenesDocument,
GQL.FindSceneMarkersDocument,
GQL.MarkerStringsDocument,
GQL.FindSceneMarkerTagsDocument,
];
export const useSceneMarkerCreate = () =>