mirror of
https://github.com/diced/zipline.git
synced 2025-12-12 07:40:45 -08:00
feat: Add check to prevent favorited files from being deleted (#369)
* additions
* add proper lock system
* migreation
* Revert "migreation"
This reverts commit 4058146c28.
* remove that
* get rid of bad code
---------
Co-authored-by: Jayvin Hernandez <gogojayvin923@gmail.com>
This commit is contained in:
@@ -42,5 +42,5 @@ UPLOADER_DISABLED_EXTENSIONS=someext
|
|||||||
URLS_ROUTE=/go
|
URLS_ROUTE=/go
|
||||||
URLS_LENGTH=6
|
URLS_LENGTH=6
|
||||||
|
|
||||||
RATELIMIT_USER = 5
|
RATELIMIT_USER=5
|
||||||
RATELIMIT_ADMIN = 3
|
RATELIMIT_ADMIN=3
|
||||||
|
|||||||
2
.github/ISSUE_TEMPLATE/config.yml
vendored
2
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,7 +1,7 @@
|
|||||||
blank_issues_enabled: false
|
blank_issues_enabled: false
|
||||||
contact_links:
|
contact_links:
|
||||||
- name: Feature Request
|
- name: Feature Request
|
||||||
url: https://github.com/diced/zipline/discussions/new?category=ideas&title=Your%20breif%20description%20here&labels=feature
|
url: https://github.com/diced/zipline/discussions/new?category=ideas&title=Your%20brief%20description%20here&labels=feature
|
||||||
about: Ask for a new feature
|
about: Ask for a new feature
|
||||||
- name: Zipline Discord
|
- name: Zipline Discord
|
||||||
url: https://discord.gg/EAhCRfGxCF
|
url: https://discord.gg/EAhCRfGxCF
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ Create an issue on GitHub, please include the following (if one of them is not a
|
|||||||
|
|
||||||
Create an discussion on GitHub, please include the following:
|
Create an discussion on GitHub, please include the following:
|
||||||
|
|
||||||
- Breif explanation of the feature in the title (very breif please)
|
- Brief explanation of the feature in the title (very brief please)
|
||||||
- How it would work (detailed, but optional)
|
- How it would work (detailed, but optional)
|
||||||
|
|
||||||
## Pull Requests (contributions to the codebase)
|
## Pull Requests (contributions to the codebase)
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ function preFileDecorator(fastify: FastifyInstance, _, done) {
|
|||||||
done();
|
done();
|
||||||
|
|
||||||
async function preFile(this: FastifyReply, file: File) {
|
async function preFile(this: FastifyReply, file: File) {
|
||||||
|
if (file.favorite) return false;
|
||||||
if (file.expiresAt && file.expiresAt < new Date()) {
|
if (file.expiresAt && file.expiresAt < new Date()) {
|
||||||
await this.server.datasource.delete(file.name);
|
await this.server.datasource.delete(file.name);
|
||||||
await this.server.prisma.file.delete({ where: { id: file.id } });
|
await this.server.prisma.file.delete({ where: { id: file.id } });
|
||||||
|
|||||||
Reference in New Issue
Block a user