-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added backend implementation. * Added backend implementation. * Added backend implementation. * Added delete and create podcasts. * Added api doc. * Added manifest.json in backend. * Added tagging system in backend * Added tagging. * Added tagging system * Fixed clippy --------- Co-authored-by: SamTV12345 <noreply+samtv1235@github.com>
- Loading branch information
1 parent
d259137
commit a397ece
Showing
44 changed files
with
1,036 additions
and
3,560 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
-- This file should undo anything in `up.sql` | ||
DROP TABLE tags; | ||
DROP TABLE |
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,33 @@ | ||
-- Your SQL goes here | ||
|
||
CREATE TABLE tags ( | ||
id TEXT NOT NULL PRIMARY KEY, | ||
name TEXT NOT NULL, | ||
username TEXT NOT NULL, | ||
description TEXT, | ||
created_at TIMESTAMP NOT NULL, | ||
color TEXT NOT NULL, | ||
UNIQUE (name, username) | ||
); | ||
|
||
CREATE TABLE tags_podcasts | ||
( | ||
tag_id TEXT NOT NULL, | ||
podcast_id INTEGER NOT NULL, | ||
FOREIGN KEY (tag_id) REFERENCES tags (id), | ||
FOREIGN KEY (podcast_id) REFERENCES podcasts (id), | ||
PRIMARY KEY (tag_id, podcast_id) | ||
); | ||
|
||
-- INDEXES | ||
CREATE INDEX idx_tags_name ON tags (name); | ||
CREATE INDEX idx_tags_username ON tags (username); | ||
CREATE INDEX idx_devices ON devices(name); | ||
CREATE INDEX idx_episodes_podcast ON episodes(podcast); | ||
CREATE INDEX idx_episodes_episode ON episodes(episode); | ||
CREATE INDEX idx_podcast_episodes ON podcast_episodes(podcast_id); | ||
CREATE INDEX idx_podcast_episodes_url ON podcast_episodes(url); | ||
CREATE INDEX idx_podcasts_name ON podcasts(name); | ||
CREATE INDEX idx_podcasts_rssfeed ON podcasts(rssfeed); | ||
CREATE INDEX idx_subscriptions ON subscriptions(username); | ||
CREATE INDEX idx_subscriptions_device ON subscriptions(device); |
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,3 @@ | ||
-- This file should undo anything in `up.sql` | ||
DROP TABLE tags; | ||
DROP TABLE |
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,34 @@ | ||
-- Your SQL goes here | ||
|
||
CREATE TABLE tags ( | ||
id TEXT NOT NULL PRIMARY KEY, | ||
name TEXT NOT NULL, | ||
username TEXT NOT NULL, | ||
description TEXT, | ||
created_at TIMESTAMP NOT NULL, | ||
color TEXT NOT NULL, | ||
UNIQUE (name, username) | ||
); | ||
|
||
CREATE TABLE tags_podcasts | ||
( | ||
tag_id TEXT NOT NULL, | ||
podcast_id INTEGER NOT NULL, | ||
FOREIGN KEY (tag_id) REFERENCES tags (id), | ||
FOREIGN KEY (podcast_id) REFERENCES podcasts (id), | ||
PRIMARY KEY (tag_id, podcast_id) | ||
); | ||
|
||
|
||
-- INDEXES | ||
CREATE INDEX idx_tags_name ON tags (name); | ||
CREATE INDEX idx_tags_username ON tags (username); | ||
CREATE INDEX idx_devices ON devices(name); | ||
CREATE INDEX idx_episodes_podcast ON episodes(podcast); | ||
CREATE INDEX idx_episodes_episode ON episodes(episode); | ||
CREATE INDEX idx_podcast_episodes ON podcast_episodes(podcast_id); | ||
CREATE INDEX idx_podcast_episodes_url ON podcast_episodes(url); | ||
CREATE INDEX idx_podcasts_name ON podcasts(name); | ||
CREATE INDEX idx_podcasts_rssfeed ON podcasts(rssfeed); | ||
CREATE INDEX idx_subscriptions ON subscriptions(username); | ||
CREATE INDEX idx_subscriptions_device ON subscriptions(device); |
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,50 @@ | ||
use actix_web::{get, HttpResponse}; | ||
use crate::constants::inner_constants::ENVIRONMENT_SERVICE; | ||
use crate::utils::error::CustomError; | ||
|
||
#[derive(Serialize)] | ||
pub struct Icon { | ||
pub src: String, | ||
pub sizes: String, | ||
pub r#type: String | ||
} | ||
|
||
|
||
#[derive(Serialize)] | ||
pub struct Manifest { | ||
pub name: String, | ||
pub short_name: String, | ||
pub start_url: String, | ||
pub icons: Vec<Icon>, | ||
pub theme_color: String, | ||
pub background_color: String, | ||
pub display: String, | ||
pub orientation: String | ||
} | ||
|
||
|
||
|
||
#[get("manifest.json")] | ||
pub async fn get_manifest() -> Result<HttpResponse, CustomError> { | ||
let env_service = ENVIRONMENT_SERVICE.get().unwrap(); | ||
let mut icons = Vec::new(); | ||
let icon = Icon{ | ||
src: env_service.server_url.to_string()+"ui/logo.png", | ||
sizes: "512x512".to_string(), | ||
r#type: "image/png".to_string() | ||
}; | ||
icons.push(icon); | ||
|
||
|
||
let manifest = Manifest{ | ||
name: "PodFetch".to_string(), | ||
short_name: "PodFetch".to_string(), | ||
start_url: env_service.server_url.to_string(), | ||
icons, | ||
orientation: "landscape".to_string(), | ||
theme_color: "#ffffff".to_string(), | ||
display: "fullscreen".to_string(), | ||
background_color: "#ffffff".to_string() | ||
}; | ||
Ok(HttpResponse::Ok().json(manifest)) | ||
} |
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
Oops, something went wrong.