Skip to content

Commit

Permalink
Fix: destroying a scene checks if the scene still exists before destr…
Browse files Browse the repository at this point in the history
…oying it

Otherwise the destroy would fail and crash the plugin. The error message wasn't great for detecting that so let's just check before destroying. There still might be cases where the scene vanishes between checking and destroying.
  • Loading branch information
MinasukiHikimuna committed Sep 5, 2024
1 parent 827a3aa commit f2be6b6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
13 changes: 11 additions & 2 deletions build_site.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,23 @@ buildPlugin()

# create a directory for the version
version=$(git log -n 1 --pretty=format:%h -- "$dir"/*)
updated=$(TZ=UTC0 git log -n 1 --date="format-local:%F %T" --pretty=format:%ad -- "$dir"/*)
updated=$(TZ=UTC0 git log -n 1 --date="format-local:%F %T" -- "$dir"/*)

# create the zip file
# copy other files
zipfile=$(realpath "$outdir/$plugin_id.zip")

pushd "$dir" > /dev/null
zip -r "$zipfile" . > /dev/null

# Check for .manifestignore file
if [ -f ".manifestignore" ]; then
# Use .manifestignore to exclude files
zip -r "$zipfile" . [email protected] > /dev/null
else
# If .manifestignore doesn't exist, include all files
zip -r "$zipfile" . > /dev/null
fi

popd > /dev/null

name=$(grep "^name:" "$f" | head -n 1 | cut -d' ' -f2- | sed -e 's/\r//' -e 's/^"\(.*\)"$/\1/')
Expand Down
6 changes: 6 additions & 0 deletions plugins/CompleteTheStash/.manifestignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
fakeInput.py
test_stash_e2e.py
.gitignore
.template-stash\missing-tpdb-config.txt
.template-stash\missing-stashdb-config.txt
.template-stash\local-config.txt
2 changes: 1 addition & 1 deletion plugins/CompleteTheStash/CompleteTheStash.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CompleteTheStash
description: Finds missing scenes for selected performers and creates missing scene metadata to another missing Stash instance. You can use either StashDB or TPDB or both as a source for missing scenes.
version: 0.4.7
version: 0.4.8
url: https://github.com/MinasukiHikimuna/MidnightRider-Stash/
exec:
- python
Expand Down
4 changes: 3 additions & 1 deletion plugins/CompleteTheStash/MissingStashClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ def create_scene(self, scene_data):
return self.missing_stash.create_scene(scene_data)

def destroy_scene(self, scene_id: int) -> None:
return self.missing_stash.destroy_scene(scene_id)
scene = self.missing_stash.find_scene(scene_id)
if scene:
return self.missing_stash.destroy_scene(scene_id)

def find_performer(self, performer_id: int) -> dict:
create = False
Expand Down

0 comments on commit f2be6b6

Please sign in to comment.