Compare commits

...

4 Commits

Author SHA1 Message Date
WithoutPants
76648fee66 Update changelog for patch release 2024-10-16 08:08:37 +11:00
WithoutPants
6d07ecf751 More scene player bug fixes (#5379)
* Don't play video when seeking non-started video
* Set initial time on load instead of play
* Continue playing from current position when switching sources on error
* Remove unnecessary ref
2024-10-15 16:03:56 +11:00
WithoutPants
5283eb8ce3 Fix duplicate items appearing in selected list (again) (#5377)
* Fix duplicate detection in useListSelect
* Prevent double invocation of select handler
2024-10-15 14:29:29 +11:00
Arshad
32c48443b5 adding exists check before dropping constraints (#5363)
Co-authored-by: Arshad Khan <arshad@Arshads-MacBook-Air-2.local>
2024-10-15 13:10:47 +11:00
6 changed files with 23 additions and 27 deletions

View File

@@ -144,9 +144,9 @@ INSERT INTO `performer_urls`
FROM `performers`
WHERE `performers`.`instagram` IS NOT NULL AND `performers`.`instagram` != '';
DROP INDEX `performers_name_disambiguation_unique`;
DROP INDEX `performers_name_unique`;
DROP TABLE `performers`;
DROP INDEX IF EXISTS `performers_name_disambiguation_unique`;
DROP INDEX IF EXISTS `performers_name_unique`;
DROP TABLE IF EXISTS `performers`;
ALTER TABLE `performers_new` rename to `performers`;
CREATE UNIQUE INDEX `performers_name_disambiguation_unique` on `performers` (`name`, `disambiguation`) WHERE `disambiguation` IS NOT NULL;

View File

@@ -229,13 +229,13 @@ export function useListSelect<T extends { id: string }>(items: T[]) {
function singleSelect(id: string, selected: boolean) {
setLastClickedId(id);
// prevent duplicates
if (selected && selectedIds.has(id)) {
return;
}
setItemsSelected((prevSelected) => {
if (selected) {
// prevent duplicates
if (prevSelected.some((v) => v.id === id)) {
return prevSelected;
}
const item = items.find((i) => i.id === id);
if (item) {
return [...prevSelected, item];

View File

@@ -243,7 +243,6 @@ export const ScenePlayer: React.FC<IScenePlayerProps> = ({
const [fullscreen, setFullscreen] = useState(false);
const [showScrubber, setShowScrubber] = useState(false);
const initialTimestamp = useRef(-1);
const started = useRef(false);
const auto = useRef(false);
const interactiveReady = useRef(false);
@@ -457,20 +456,6 @@ export const ScenePlayer: React.FC<IScenePlayerProps> = ({
if (this.currentTime() >= 0.1) {
return;
}
if (initialTimestamp.current !== -1) {
this.currentTime(initialTimestamp.current);
initialTimestamp.current = -1;
}
}
function timeupdate(this: VideoJsPlayer) {
// fired when seeking
// check if we haven't started playing yet
// if so, start playing
if (!started.current) {
this.play();
}
}
function playing(this: VideoJsPlayer) {
@@ -493,14 +478,12 @@ export const ScenePlayer: React.FC<IScenePlayerProps> = ({
player.on("playing", playing);
player.on("loadstart", loadstart);
player.on("fullscreenchange", fullscreenchange);
player.on("timeupdate", timeupdate);
return () => {
player.off("canplay", canplay);
player.off("playing", playing);
player.off("loadstart", loadstart);
player.off("fullscreenchange", fullscreenchange);
player.off("timeupdate", timeupdate);
};
}, [getPlayer]);
@@ -675,7 +658,6 @@ export const ScenePlayer: React.FC<IScenePlayerProps> = ({
startPosition = resumeTime;
}
initialTimestamp.current = startPosition;
setTime(startPosition);
player.load();
@@ -683,6 +665,10 @@ export const ScenePlayer: React.FC<IScenePlayerProps> = ({
player.ready(() => {
player.vttThumbnails().src(scene.paths.vtt ?? null);
if (startPosition) {
player.currentTime(startPosition);
}
});
started.current = false;
@@ -811,7 +797,6 @@ export const ScenePlayer: React.FC<IScenePlayerProps> = ({
if (started.current) {
getPlayer()?.currentTime(seconds);
} else {
initialTimestamp.current = seconds;
setTime(seconds);
}
}

View File

@@ -196,8 +196,12 @@ class SourceSelectorPlugin extends videojs.getPlugin("plugin") {
console.log(`Trying next source in playlist: '${newSource.label}'`);
this.menu.setSelectedSource(newSource);
const currentTime = player.currentTime();
player.src(newSource);
player.load();
player.one("canplay", () => {
player.currentTime(currentTime);
});
player.play();
} else {
console.log("No more sources in playlist");

View File

@@ -154,6 +154,7 @@ export const GridCard: React.FC<ICardProps> = (props: ICardProps) => {
if (props.selecting) {
props.onSelectedChanged(!props.selected, shiftKey);
event.preventDefault();
event.stopPropagation();
}
}

View File

@@ -16,6 +16,7 @@
* Added option to rescan all files in the Scan task. ([#5254](https://github.com/stashapp/stash/pull/5254))
### 🎨 Improvements
* **[0.27.2]** Scene player now shows the starting position when resume time is set. ([#5379](https://github.com/stashapp/stash/pull/5379))
* **[0.27.1]** Live transcode requests are now debounced to spawn fewer `ffmpeg` instances while scrubbing. ([#5340](https://github.com/stashapp/stash/pull/5340))
* **[0.27.1]** Blobs location may now be set using environment variable `STASH_BLOBS`. ([#5345](https://github.com/stashapp/stash/pull/5345))
* Added button to view sub-studio/sub-tag content on Studio/Tag details pages. ([#5080](https://github.com/stashapp/stash/pull/5080))
@@ -31,6 +32,11 @@
* Scene Player now allows interacting with the controls before playing video, and errors no longer prevent interacting with the Scene Player. ([#5145](https://github.com/stashapp/stash/pull/5145))
### 🐛 Bug fixes
* **[0.27.2]** Fixed items being selected twice when selecting items in the Grid list. ([#5377](https://github.com/stashapp/stash/pull/5377))
* **[0.27.2]** Fixed 62 migration error for some users. ([#5363](https://github.com/stashapp/stash/pull/5363))
* **[0.27.2]** Fixed scenes incorrectly autoplaying on queue selection. ([#5379](https://github.com/stashapp/stash/pull/5379))
* **[0.27.2]** Videos no longer begin playing when seeking before video has started. ([#5379](https://github.com/stashapp/stash/pull/5379))
* **[0.27.2]** Videos will now resume from the correct time when switching sources due to error. ([#5379](https://github.com/stashapp/stash/pull/5379))
* **[0.27.1]** Fixed UI infinite loop when sorting by random without a seed in the URL. ([#5319](https://github.com/stashapp/stash/pull/5319))
* **[0.27.1]** Fixed dropdowns not displaying correctly in the merge dialogs. ([#5299](https://github.com/stashapp/stash/pull/5299))
* **[0.27.1]** For single URLs, link icon now shows the dropdown menu instead of navigating to the URL. ([#5310](https://github.com/stashapp/stash/pull/5310))