Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New feat : Upload image in torrent upload page & torrent detail #60

Merged
merged 26 commits into from
Oct 29, 2023
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
6ccbd81
Fixed an issue with Docker configuration.
Klaiment Oct 9, 2023
2e94106
locale fr added + yarn lint
Klaiment Oct 10, 2023
7c1dd18
image upload from torrent upload page.
Klaiment Oct 10, 2023
ee8a52c
basic image upload ok in all page.
Klaiment Oct 11, 2023
6aa9918
yarn lint
Klaiment Oct 11, 2023
912835e
big yarn lint
Klaiment Oct 11, 2023
bc8abbb
Final commit, poster upload for torrent.
Klaiment Oct 11, 2023
e3841eb
Merge pull request #1 from Klaiment/Feat/frenchLocale
Klaiment Oct 11, 2023
57537c6
Merge pull request #2 from Klaiment/Feat/torrentUploadImage
Klaiment Oct 11, 2023
3b2bc07
Update .gitignore
Klaiment Oct 12, 2023
1cdc2b8
Update .gitignore
Klaiment Oct 12, 2023
c310838
Update Dockerfile
Klaiment Oct 12, 2023
4bd8d48
Update Dockerfile
Klaiment Oct 12, 2023
cf47dfd
Update torrent.js
Klaiment Oct 12, 2023
54276bc
Update Dockerfile
Klaiment Oct 12, 2023
7f3d6e1
Update config.example.js
Klaiment Oct 12, 2023
13f0411
Update docker-compose.dev.yml
Klaiment Oct 12, 2023
f99252f
Update upload.js
Klaiment Oct 12, 2023
8bf508b
Update [infoHash].js
Klaiment Oct 12, 2023
e17bd4c
CamelCase & alphabetical order
Klaiment Oct 12, 2023
ace3f1e
Merge pull request #4 from Klaiment/Fix/locales
Klaiment Oct 12, 2023
375db33
Poster => Cover image
Klaiment Oct 12, 2023
cfba440
Merge pull request #5 from Klaiment/Fix/locales
Klaiment Oct 12, 2023
3b8604b
Fix to make cover image not required. and optimization of my personal…
Klaiment Oct 12, 2023
2426fef
Merge pull request #6 from Klaiment/Fix/poster
Klaiment Oct 12, 2023
1694103
Update [infoHash].js
Klaiment Oct 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
client/.next
data/
config.js
config.example.js
Klaiment marked this conversation as resolved.
Show resolved Hide resolved
yarn.lock
.DS_Store
dist/
letsencrypt/
Expand Down
2 changes: 1 addition & 1 deletion api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM node:16-alpine
ENV NODE_ENV=production
ENV NODE_ENV=development
Klaiment marked this conversation as resolved.
Show resolved Hide resolved
ENV SENTRY_DSN="https://9b9761216607428180ea3b32bd1c8e58@o140996.ingest.sentry.io/4504645996576768"
LABEL org.opencontainers.image.source=https://github.com/tdjsnelling/sqtracker
WORKDIR /sqtracker/app
Expand Down
4 changes: 3 additions & 1 deletion api/src/controllers/torrent.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export const uploadTorrent = async (req, res, next) => {
source: req.body.source,
infoHash,
binary: req.body.torrent,
poster: req.body.poster,
uploadedBy: req.userId,
downloads: 0,
anonymous: false,
Expand All @@ -154,7 +155,6 @@ export const uploadTorrent = async (req, res, next) => {
group: groupId,
mediaInfo: req.body.mediaInfo,
});

await newTorrent.save();

if (groupId) await addToGroup(groupId, infoHash);
Expand Down Expand Up @@ -287,6 +287,7 @@ export const fetchTorrent = (tracker) => async (req, res, next) => {
uploadedBy: 1,
downloads: 1,
anonymous: 1,
poster: 1,
size: 1,
files: 1,
created: 1,
Expand Down Expand Up @@ -507,6 +508,7 @@ export const getTorrentsPage = async ({
created: 1,
freeleech: 1,
tags: 1,
poster: 1,
Klaiment marked this conversation as resolved.
Show resolved Hide resolved
confidenceScore: 1,
},
},
Expand Down
1 change: 1 addition & 0 deletions api/src/schema/torrent.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import fuzzySearch from "mongoose-fuzzy-searching";
const Torrent = new mongoose.Schema({
infoHash: String,
binary: String,
poster: String,
uploadedBy: mongoose.Schema.ObjectId,
name: String,
description: String,
Expand Down
4 changes: 2 additions & 2 deletions client/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM node:16-alpine AS builder
ARG SENTRY_AUTH_TOKEN
ENV NODE_ENV=production
ENV NODE_ENV=development
Klaiment marked this conversation as resolved.
Show resolved Hide resolved
ENV SENTRY_ORG=tdjsnelling
ENV SENTRY_PROJECT=sqtracker-frontend
ENV SENTRY_AUTH_TOKEN=${SENTRY_AUTH_TOKEN}
Expand All @@ -11,7 +11,7 @@ RUN echo "{}" > /config.js
RUN ./node_modules/.bin/next build

FROM node:16-alpine
ENV NODE_ENV=production
ENV NODE_ENV=development
Klaiment marked this conversation as resolved.
Show resolved Hide resolved
ENV SENTRY_DSN="https://22bc43683da04040aa90e7683ffe022a@o140996.ingest.sentry.io/4504646040616960"
LABEL org.opencontainers.image.source=https://github.com/tdjsnelling/sqtracker
WORKDIR /sqtracker/client
Expand Down
5 changes: 4 additions & 1 deletion client/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@
"passwordResetRequestFailed": "Passwort zurücksetzen konnte nicht initiallisiert werden",
"passwordResetSuccess": "Passwort wurde erfolgreich zurückgesetzt",
"passwordResetFailed": "Passwort wurde nicht erfolgreich zurückgesetzt",
"tokenError": "Token Fehler"
"tokenError": "Token Fehler",
"uploadPosterImage": "Posterdatei",
"PosterImage": "Poster",
"uploadDragDropClickSelectPoster": "Ziehen Sie Ihre Posterdatei hierher oder klicken Sie, um sie auszuwählen"
}
5 changes: 4 additions & 1 deletion client/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,5 +304,8 @@
"wikiPages": "Pages",
"wikiSaveChanges": "Save changes",
"wikiThereNothingHereYet": "There is nothing here yet.",
"wikiDelThisPageQ": "Are you sure you want to delete this wiki page? This cannot be undone."
"wikiDelThisPageQ": "Are you sure you want to delete this wiki page? This cannot be undone.",
"uploadPosterImage": "Poster file",
"PosterImage": "Poster",
Klaiment marked this conversation as resolved.
Show resolved Hide resolved
"uploadDragDropClickSelectPoster": "Drag and drop your poster file here, or click to select"
}
5 changes: 4 additions & 1 deletion client/locales/eo.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,5 +302,8 @@
"wikiPages": "Paĝoj",
"wikiSaveChanges": "Konservi ŝanĝojn",
"wikiThereNothingHereYet": "Ankoraŭ estas nenio ĉi tie.",
"wikiDelThisPageQ": "Ĉu vi certas, ke vi volas forigi ĉi tiun vikipaĝon? Ĉi tio ne povas esti malfarita."
"wikiDelThisPageQ": "Ĉu vi certas, ke vi volas forigi ĉi tiun vikipaĝon? Ĉi tio ne povas esti malfarita.",
"uploadPosterImage": "Alŝuti afiŝo-dosieron",
"PosterImage": "Afiŝo",
"uploadDragDropClickSelectPoster": "Tiri kaj demeti vian afiŝo-dosieron ĉi tien, aŭ klaku por elekti"
}
Loading