Skip to content

Commit

Permalink
switch to using database for video metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
abamaxa committed Dec 30, 2023
1 parent 7b0e3c0 commit 67efeb0
Show file tree
Hide file tree
Showing 50 changed files with 916 additions and 795 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ Cargo.lock
client_src
docs/.lock
.DS_Store
*.sqlite
*.sqlite*
.vscode
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tvserver"
version = "0.6.2"
version = "0.7.0"
edition = "2021"
authors = ["Chris Morgan <cmorgan@abamaxa.com>"]
repository = "https://github.com/abamaxa/tvserver"
Expand Down Expand Up @@ -38,6 +38,7 @@ tracing = "0.1.35"
tracing-subscriber = { version = "0.3.16", features = ["env-filter"] }
transmission-rpc = "0.4.1"
urlencoding = "2.1.2"
itertools = "0.11.0"


[patch.crates-io]
Expand Down
2 changes: 1 addition & 1 deletion client/app/404.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>404: This page could not be found</title><meta name="next-head-count" content="3"/><link rel="preload" href="/_next/static/css/d20de34f7fea9fe4.css" as="style"/><link rel="stylesheet" href="/_next/static/css/d20de34f7fea9fe4.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-87b3a303122f2f0d.js" defer=""></script><script src="/_next/static/chunks/framework-2c79e2a64abdb08b.js" defer=""></script><script src="/_next/static/chunks/main-87ca427ebfff238b.js" defer=""></script><script src="/_next/static/chunks/pages/_app-2ddf65715eee6393.js" defer=""></script><script src="/_next/static/chunks/pages/_error-54de1933a164a1ff.js" defer=""></script><script src="/_next/static/_v9Is_IPfRYUWR8gHsmaW/_buildManifest.js" defer=""></script><script src="/_next/static/_v9Is_IPfRYUWR8gHsmaW/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block;text-align:left"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"_v9Is_IPfRYUWR8gHsmaW","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>404: This page could not be found</title><meta name="next-head-count" content="3"/><link rel="preload" href="/_next/static/css/d20de34f7fea9fe4.css" as="style"/><link rel="stylesheet" href="/_next/static/css/d20de34f7fea9fe4.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-87b3a303122f2f0d.js" defer=""></script><script src="/_next/static/chunks/framework-2c79e2a64abdb08b.js" defer=""></script><script src="/_next/static/chunks/main-87ca427ebfff238b.js" defer=""></script><script src="/_next/static/chunks/pages/_app-2ddf65715eee6393.js" defer=""></script><script src="/_next/static/chunks/pages/_error-54de1933a164a1ff.js" defer=""></script><script src="/_next/static/HN6kpO_FXNSXmQI5ReEGx/_buildManifest.js" defer=""></script><script src="/_next/static/HN6kpO_FXNSXmQI5ReEGx/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block;text-align:left"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"HN6kpO_FXNSXmQI5ReEGx","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

This file was deleted.

2 changes: 1 addition & 1 deletion client/app/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/d20de34f7fea9fe4.css" as="style"/><link rel="stylesheet" href="/_next/static/css/d20de34f7fea9fe4.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-87b3a303122f2f0d.js" defer=""></script><script src="/_next/static/chunks/framework-2c79e2a64abdb08b.js" defer=""></script><script src="/_next/static/chunks/main-87ca427ebfff238b.js" defer=""></script><script src="/_next/static/chunks/pages/_app-2ddf65715eee6393.js" defer=""></script><script src="/_next/static/chunks/0b308cfb-6f02427547e2ca4c.js" defer=""></script><script src="/_next/static/chunks/d64684d8-9cf88cb93f630a09.js" defer=""></script><script src="/_next/static/chunks/256-2c027a1aaf0d620e.js" defer=""></script><script src="/_next/static/chunks/pages/index-cbda8d871c729d68.js" defer=""></script><script src="/_next/static/_v9Is_IPfRYUWR8gHsmaW/_buildManifest.js" defer=""></script><script src="/_next/static/_v9Is_IPfRYUWR8gHsmaW/_ssgManifest.js" defer=""></script></head><body><div id="__next"><p>Loading...</p></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/","query":{},"buildId":"_v9Is_IPfRYUWR8gHsmaW","nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/d20de34f7fea9fe4.css" as="style"/><link rel="stylesheet" href="/_next/static/css/d20de34f7fea9fe4.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-87b3a303122f2f0d.js" defer=""></script><script src="/_next/static/chunks/framework-2c79e2a64abdb08b.js" defer=""></script><script src="/_next/static/chunks/main-87ca427ebfff238b.js" defer=""></script><script src="/_next/static/chunks/pages/_app-2ddf65715eee6393.js" defer=""></script><script src="/_next/static/chunks/0b308cfb-6f02427547e2ca4c.js" defer=""></script><script src="/_next/static/chunks/d64684d8-9cf88cb93f630a09.js" defer=""></script><script src="/_next/static/chunks/256-2c027a1aaf0d620e.js" defer=""></script><script src="/_next/static/chunks/pages/index-31df0e42c4d82c19.js" defer=""></script><script src="/_next/static/HN6kpO_FXNSXmQI5ReEGx/_buildManifest.js" defer=""></script><script src="/_next/static/HN6kpO_FXNSXmQI5ReEGx/_ssgManifest.js" defer=""></script></head><body><div id="__next"><p>Loading...</p></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/","query":{},"buildId":"HN6kpO_FXNSXmQI5ReEGx","nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
6 changes: 3 additions & 3 deletions client/player/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"files": {
"main.css": "/player/static/css/main.391ec4e1.css",
"main.js": "/player/static/js/main.19d00dea.js",
"main.js": "/player/static/js/main.cbacf082.js",
"index.html": "/player/index.html",
"main.391ec4e1.css.map": "/player/static/css/main.391ec4e1.css.map",
"main.19d00dea.js.map": "/player/static/js/main.19d00dea.js.map"
"main.cbacf082.js.map": "/player/static/js/main.cbacf082.js.map"
},
"entrypoints": [
"static/css/main.391ec4e1.css",
"static/js/main.19d00dea.js"
"static/js/main.cbacf082.js"
]
}
2 changes: 1 addition & 1 deletion client/player/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><title>Video Player</title><script defer="defer" src="/player/static/js/main.19d00dea.js"></script><link href="/player/static/css/main.391ec4e1.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><title>Video Player</title><script defer="defer" src="/player/static/js/main.cbacf082.js"></script><link href="/player/static/css/main.391ec4e1.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client_src/remote_player
2 changes: 1 addition & 1 deletion env.sample
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
RUST_BACKTRACE=1
CLIENT_DIR=/var/www/client
DATABASE_URL=:memory:
DATABASE_MIGRATION_DIR=/usr/src/tvserver/migrations
DATABASE_MIGRATION_DIR=./migrations
MOVIE_DIR=/Movies
TRANSMISSION_USER=transmission
TRANSMISSION_PWD=abcd1234
Expand Down
8 changes: 6 additions & 2 deletions migrations/20221226000001_initial.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ CREATE TABLE IF NOT EXISTS video_details (
height INTEGER,
audio_tracks INTEGER,
search_phrase TEXT,
added TIMESTAMP DEFAULT CURRENT_TIMESTAMP
state INTEGER DEFAULT 0,
created_on TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_on TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE INDEX IF NOT EXISTS idx_collection ON video_details(collection, video);

CREATE TABLE IF NOT EXISTS history (
path TEXT PRIMARY KEY NOT NULL,
checksum INTEGER PRIMARY KEY NOT NULL,
started TIMESTAMP,
stopped TIMESTAMP
);
1 change: 0 additions & 1 deletion migrations/20231008000001_collections.sql

This file was deleted.

Loading

0 comments on commit 67efeb0

Please sign in to comment.