-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Replace torrents with magnet links (#108)
* feat: add discord release yml * chore(main): release 0.13.0 (#101) * chore: removed a sponsor * fix: update discord notification * chore: fix notification breaking syntax * fix: add new states to the frontend (#106) * add new states to frontend * lint the previous commit * add new states to summary view * lint the workflow at request of @AyushSehrawat * fix: minor statistics page improvement * chore(main): release 0.13.1 (#102) * feat: enable adding torrent with magnet links * feat: add folder information to manage sheet * style: make the button text clearer * refactor: cleanup debug code * feat: magnet link add for shows * feat: improve error messages * feat: information about the selected episode/season * refactor: remove debug property * style: formatting --------- Co-authored-by: Ayush Sehrawat <[email protected]> Co-authored-by: Spoked <[email protected]>
- Loading branch information
1 parent
22ddbb3
commit a6bf0e1
Showing
9 changed files
with
243 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
github-releases-to-discord: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Github Releases To Discord | ||
uses: SethCohen/[email protected] # latest version breaks syntax in discord. stick to 1.13.1 | ||
with: | ||
webhook_url: ${{ secrets.WEBHOOK_URL }} | ||
color: '2105893' | ||
username: 'Release Changelog' | ||
avatar_url: 'https://raw.githubusercontent.com/rivenmedia/riven/main/assets/riven-light.png' | ||
# content: "||@everyone||" | ||
footer_title: 'Riven (Frontend) Changelog' | ||
footer_icon_url: 'https://raw.githubusercontent.com/rivenmedia/riven/main/assets/riven-light.png' | ||
footer_timestamp: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import type { RequestHandler } from './$types'; | ||
|
||
export const POST: RequestHandler = async ({ params, locals, request }) => { | ||
const id = params.id; | ||
const magnet = (await request.json())['magnet']; | ||
|
||
if (!magnet) { | ||
return new Response( | ||
JSON.stringify({ | ||
error: 'No magnet provided' | ||
}), | ||
{ | ||
status: 400, | ||
headers: { | ||
'Content-Type': 'application/json' | ||
} | ||
} | ||
); | ||
} | ||
|
||
const url = new URL(`${locals.BACKEND_URL}/items/${id}/set_torrent_rd_magnet`); | ||
url.searchParams.set('magnet', magnet); | ||
|
||
try { | ||
const response = await fetch(url, { | ||
method: 'POST' | ||
}); | ||
|
||
const data = await response.json(); | ||
if (response.ok) { | ||
return new Response( | ||
JSON.stringify({ | ||
success: 'Magnet link added', | ||
data | ||
}), | ||
{ | ||
status: 200, | ||
headers: { | ||
'Content-Type': 'application/json' | ||
} | ||
} | ||
); | ||
} else { | ||
return new Response( | ||
JSON.stringify({ | ||
error: data.detail | ||
}), | ||
{ | ||
status: 500, | ||
headers: { | ||
'Content-Type': 'application/json' | ||
} | ||
} | ||
); | ||
} | ||
} catch { | ||
return new Response( | ||
JSON.stringify({ | ||
error: 'Failed to reach backend' | ||
}), | ||
{ | ||
status: 500, | ||
headers: { | ||
'Content-Type': 'application/json' | ||
} | ||
} | ||
); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.12.1 | ||
0.13.1 |