aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-01-15 13:17:58 +0100
committermetamuffin <metamuffin@disroot.org>2024-01-15 13:17:58 +0100
commita0fd6f2943d69d2f3e13fcf80fb567bb821eef9f (patch)
treead0cfc71fa1b1a558773686dc93e92f5b546088b
parenta5ad49451e80cae7ec7f5d2a216084aa30e2e704 (diff)
downloadjellything-a0fd6f2943d69d2f3e13fcf80fb567bb821eef9f.tar
jellything-a0fd6f2943d69d2f3e13fcf80fb567bb821eef9f.tar.bz2
jellything-a0fd6f2943d69d2f3e13fcf80fb567bb821eef9f.tar.zst
cleanup some old code
-rw-r--r--base/src/temp.rs3
-rw-r--r--common/src/lib.rs3
-rw-r--r--remuxer/src/lib.rs2
-rw-r--r--remuxer/src/segment_extractor.rs10
-rw-r--r--remuxer/src/snippet.rs1
-rw-r--r--remuxer/src/trim_writer.rs5
-rw-r--r--server/src/routes/ui/account/mod.rs5
7 files changed, 8 insertions, 21 deletions
diff --git a/base/src/temp.rs b/base/src/temp.rs
index 8da85f7..ee44004 100644
--- a/base/src/temp.rs
+++ b/base/src/temp.rs
@@ -3,12 +3,11 @@
which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
Copyright (C) 2023 metamuffin <metamuffin.org>
*/
+use crate::AssetLocationExt;
use anyhow::Context;
use jellycommon::AssetLocation;
use std::{fs::File, sync::atomic::AtomicUsize};
-use crate::AssetLocationExt;
-
static TEMP_COUNTER: AtomicUsize = AtomicUsize::new(0);
pub struct TempFile(pub AssetLocation);
diff --git a/common/src/lib.rs b/common/src/lib.rs
index 1903529..c126e65 100644
--- a/common/src/lib.rs
+++ b/common/src/lib.rs
@@ -11,10 +11,11 @@ pub mod seek_index;
pub mod stream;
pub mod user;
-use bincode::{Decode, Encode};
pub use chrono;
+use bincode::{Decode, Encode};
use chrono::{DateTime, Utc};
+
#[cfg(feature = "rocket")]
use rocket::{FromFormField, UriDisplayQuery};
use serde::{Deserialize, Serialize};
diff --git a/remuxer/src/lib.rs b/remuxer/src/lib.rs
index 88f1916..86ec166 100644
--- a/remuxer/src/lib.rs
+++ b/remuxer/src/lib.rs
@@ -3,13 +3,13 @@
which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
Copyright (C) 2023 metamuffin <metamuffin.org>
*/
+pub mod extract;
pub mod import;
pub mod remux;
pub mod seek_index;
pub mod segment_extractor;
pub mod snippet;
pub mod trim_writer;
-pub mod extract;
pub use remux::remux_stream_into;
pub use snippet::write_snippet_into;
diff --git a/remuxer/src/segment_extractor.rs b/remuxer/src/segment_extractor.rs
index 84c53f3..01f86f0 100644
--- a/remuxer/src/segment_extractor.rs
+++ b/remuxer/src/segment_extractor.rs
@@ -7,16 +7,6 @@ use anyhow::{anyhow, bail, Result};
use jellymatroska::{block::Block, read::EbmlReader, unflatten::IterWithPos, Master, MatroskaTag};
use log::{debug, info, trace};
-// pub struct AbsoluteBlock {
-// pub pts_base: u64,
-// pub inner: Block,
-// }
-// impl AbsoluteBlock {
-// pub fn pts(&self) -> u64 {
-// self.inner.timestamp_off as u64 + self.pts_base
-// }
-// }
-
pub struct SegmentExtractIter<'a> {
segment: &'a mut EbmlReader,
extract: u64,
diff --git a/remuxer/src/snippet.rs b/remuxer/src/snippet.rs
index 0d5c715..50df2d1 100644
--- a/remuxer/src/snippet.rs
+++ b/remuxer/src/snippet.rs
@@ -85,7 +85,6 @@ pub fn write_snippet_into(
debug!("\t seek index: {} blocks loaded", index.blocks.len());
let mut reader = EbmlReader::new(file);
- // TODO maybe refactor this to approx. contant time per snippet
let average_kf_interval = media_info.duration / index.keyframes.len() as f64;
let kf_per_snip = (SNIPPET_LENGTH / average_kf_interval).ceil() as usize;
debug!("average keyframe interval: {average_kf_interval}");
diff --git a/remuxer/src/trim_writer.rs b/remuxer/src/trim_writer.rs
index 2a7fb84..5890ee9 100644
--- a/remuxer/src/trim_writer.rs
+++ b/remuxer/src/trim_writer.rs
@@ -3,14 +3,13 @@
which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
Copyright (C) 2023 metamuffin <metamuffin.org>
*/
+use anyhow::anyhow;
+use log::{trace, warn};
use std::{
io::{Seek, Write},
ops::Range,
};
-use anyhow::anyhow;
-use log::{trace, warn};
-
pub struct TrimWriter<W> {
inner: W,
position: usize,
diff --git a/server/src/routes/ui/account/mod.rs b/server/src/routes/ui/account/mod.rs
index 543fa48..cd8695f 100644
--- a/server/src/routes/ui/account/mod.rs
+++ b/server/src/routes/ui/account/mod.rs
@@ -6,8 +6,6 @@
pub mod session;
pub mod settings;
-use std::collections::HashSet;
-
use super::{error::MyError, layout::LayoutPage};
use crate::{
database::Database,
@@ -31,6 +29,7 @@ use rocket::{
FromForm, State,
};
use serde::{Deserialize, Serialize};
+use std::collections::HashSet;
#[derive(FromForm)]
pub struct RegisterForm {
@@ -156,7 +155,7 @@ pub fn r_account_register_post<'a>(
content: markup::new! {
h1 { @if logged_in {
"Registration successful, you may switch account now."
- } else {
+ } else {
"Registration successful, you may log in now."
}}
},