summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormsglm <msglm@techchud.xyz>2023-10-06 02:11:13 -0500
committermsglm <msglm@techchud.xyz>2023-10-06 02:11:13 -0500
commit50a309ae0132a3703299e5d42a5b4b594d648554 (patch)
tree80df63ae65e5d386e0b6d4837384f815c641298c
parent62d949fd4b81919e383d21f13cfef259e200dcbd (diff)
downloadsortunsorted-master.tar.gz
sortunsorted-master.tar.bz2
sortunsorted-master.zip
properly implement ipfs supportHEADv1.0.1master
-rwxr-xr-xsortunsorted42
1 files changed, 10 insertions, 32 deletions
diff --git a/sortunsorted b/sortunsorted
index 2fd72b2..fe7eb6c 100755
--- a/sortunsorted
+++ b/sortunsorted
@@ -9,8 +9,7 @@
numofvids=1
playablevideo="$(find ~/Videos/unsorted/ -maxdepth 1 -type f | shuf | head -1)"
-if [[ $# = 0 ]]
-then
+playvid() {
if [[ "${playablevideo##*.}" == "png" || "${playablevideo##*.}" == "jpg" || "${playablevideo##*.}" == "jpeg" || "${playablevideo##*.}" == "webp" ]]
then
feh "$playablevideo"
@@ -25,54 +24,33 @@ then
touch "$playablevideo"
if [[ "${playablevideo##*.}" == "gif" ]]
then
+ ipfs-archive-manager shitpost-gifs "./$Name.${playablevideo##*.}" "$playablevideo"
mv "$playablevideo" "/home/$USER/Pictures/gif/$Name.${playablevideo##*.}"
elif [[ "${playablevideo##*.}" == "png" || "${playablevideo##*.}" == "jpg" || "${playablevideo##*.}" == "jpeg" || "${playablevideo##*.}" == "webp" ]]
then
+ ipfs-archive-manager shitpost-pictures "./$Name.${playablevideo##*.}" "$playablevideo"
mv "$playablevideo" "/home/$USER/Pictures/$Name.${playablevideo##*.}"
else
+ ipfs-archive-manager shitpost-videos "./$Name.${playablevideo##*.}" "$playablevideo"
mv "$playablevideo" "/home/$USER/Videos/$Name.${playablevideo##*.}"
fi
-
- exit
elif [ "$Choice" = 'n' ]
then
trash "$playablevideo"
else
echo "You did nothing..."
fi
- exit
+}
+if [[ $# = 0 ]]
+then
+ playvid
+ exit
fi
while [[ "$numofvids" -le "$1" ]]
do
- if [[ "${playablevideo##*.}" == "png" || "${playablevideo##*.}" == "jpg" || "${playablevideo##*.}" == "jpeg" || "${playablevideo##*.}" == "webp" ]]
- then
- feh "$playablevideo"
- else
- mpv --ontop --geometry=50%:50% --autofit=50%x50% "$playablevideo"
- fi
- echo "Video played was: $playablevideo"
- read -r -p "Was This quality? (y/n): " Choice
- if [ "$Choice" = 'y' ]
- then
- read -r -p "What would you like to name the video?: " Name
- touch "$playablevideo"
- if [[ "${playablevideo##*.}" == "gif" ]]
- then
- mv "$playablevideo" "/home/$USER/Pictures/gif/$Name.${playablevideo##*.}"
- elif [[ "${playablevideo##*.}" == "png" || "${playablevideo##*.}" == "jpg" || "${playablevideo##*.}" == "jpeg" || "${playablevideo##*.}" == "webp" ]]
- then
- mv "$playablevideo" "/home/$USER/Pictures/$Name.${playablevideo##*.}"
- else
- mv "$playablevideo" "/home/$USER/Videos/$Name.${playablevideo##*.}"
- fi
- elif [ "$Choice" = 'n' ]
- then
- trash "$playablevideo"
- else
- echo "You did nothing..."
- fi
+ playvid
playablevideo="$(find ~/Videos/unsorted/ -maxdepth 1 -type f | shuf | head -1)"
numofvids=$numofvids+1
done