style: 尽量使用绝对路径引入包 (#81)
This commit is contained in:
@@ -9,7 +9,7 @@ use rsa::sha2::Sha256;
|
||||
use rsa::{Oaep, RsaPublicKey};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use super::error::BiliError;
|
||||
use crate::bilibili::error::BiliError;
|
||||
use crate::bilibili::Client;
|
||||
|
||||
#[derive(Default, Debug, Clone, Serialize, Deserialize)]
|
||||
|
||||
@@ -5,8 +5,8 @@ use std::pin::Pin;
|
||||
use anyhow::Result;
|
||||
use tokio::io::{AsyncWrite, AsyncWriteExt, BufWriter};
|
||||
|
||||
use super::canvas::CanvasConfig;
|
||||
use crate::bilibili::danmaku::{DrawEffect, Drawable};
|
||||
use crate::bilibili::danmaku::canvas::CanvasConfig;
|
||||
use crate::bilibili::danmaku::{DanmakuOption, DrawEffect, Drawable};
|
||||
|
||||
struct TimePoint {
|
||||
t: f64,
|
||||
@@ -38,7 +38,7 @@ impl fmt::Display for AssEffect {
|
||||
}
|
||||
}
|
||||
|
||||
impl super::DanmakuOption {
|
||||
impl DanmakuOption {
|
||||
pub fn ass_styles(&self) -> Vec<String> {
|
||||
vec![
|
||||
// Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, \
|
||||
@@ -196,6 +196,7 @@ fn escape_text(text: &str) -> Cow<str> {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn time_point_fmt() {
|
||||
assert_eq!(format!("{}", TimePoint { t: 0.0 }), "0:00:00.00");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use super::CanvasConfig;
|
||||
use crate::bilibili::danmaku::canvas::CanvasConfig;
|
||||
use crate::bilibili::danmaku::Danmu;
|
||||
|
||||
pub enum Collision {
|
||||
|
||||
@@ -5,10 +5,9 @@ use anyhow::Result;
|
||||
use float_ord::FloatOrd;
|
||||
use lane::Lane;
|
||||
|
||||
use super::{Danmu, Drawable};
|
||||
use crate::bilibili::danmaku::canvas::lane::Collision;
|
||||
use crate::bilibili::danmaku::danmu::DanmuType;
|
||||
use crate::bilibili::danmaku::DrawEffect;
|
||||
use crate::bilibili::danmaku::{Danmu, DrawEffect, Drawable};
|
||||
use crate::bilibili::PageInfo;
|
||||
|
||||
#[derive(Debug, serde::Deserialize, serde::Serialize)]
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
//! 一个弹幕实例,但是没有位置信息
|
||||
use anyhow::{bail, Result};
|
||||
|
||||
use super::canvas::CanvasConfig;
|
||||
use crate::bilibili::danmaku::canvas::CanvasConfig;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
|
||||
pub enum DanmuType {
|
||||
#[default]
|
||||
|
||||
@@ -3,8 +3,8 @@ use std::path::PathBuf;
|
||||
use anyhow::Result;
|
||||
use tokio::fs::{self, File};
|
||||
|
||||
use super::canvas::CanvasConfig;
|
||||
use super::{AssWriter, Danmu};
|
||||
use crate::bilibili::danmaku::canvas::CanvasConfig;
|
||||
use crate::bilibili::danmaku::{AssWriter, Danmu};
|
||||
use crate::bilibili::PageInfo;
|
||||
use crate::config::CONFIG;
|
||||
|
||||
|
||||
@@ -4,10 +4,9 @@ use futures::TryStreamExt;
|
||||
use prost::Message;
|
||||
use reqwest::Method;
|
||||
|
||||
use super::danmaku::{DanmakuElem, DanmakuWriter};
|
||||
use crate::bilibili::analyzer::PageAnalyzer;
|
||||
use crate::bilibili::client::BiliClient;
|
||||
use crate::bilibili::danmaku::DmSegMobileReply;
|
||||
use crate::bilibili::danmaku::{DanmakuElem, DanmakuWriter, DmSegMobileReply};
|
||||
use crate::bilibili::error::BiliError;
|
||||
|
||||
static MASK_CODE: u64 = 2251799813685247;
|
||||
|
||||
@@ -16,14 +16,12 @@ use serde_json::json;
|
||||
use tokio::fs;
|
||||
use tokio::sync::{Mutex, Semaphore};
|
||||
|
||||
use super::status::{PageStatus, VideoStatus};
|
||||
use super::utils::{
|
||||
unhandled_videos_pages, update_pages_model, update_videos_model, ModelWrapper, NFOMode, NFOSerializer, TEMPLATE,
|
||||
};
|
||||
use crate::bilibili::{BestStream, BiliClient, BiliError, Dimension, FavoriteList, PageInfo, Video};
|
||||
use crate::config::CONFIG;
|
||||
use crate::core::status::{PageStatus, VideoStatus};
|
||||
use crate::core::utils::{
|
||||
create_video_pages, create_videos, exist_labels, filter_unfilled_videos, handle_favorite_info, total_video_count,
|
||||
unhandled_videos_pages, update_pages_model, update_videos_model, ModelWrapper, NFOMode, NFOSerializer, TEMPLATE,
|
||||
};
|
||||
use crate::downloader::Downloader;
|
||||
use crate::error::{DownloadAbortError, ProcessPageError};
|
||||
|
||||
@@ -16,9 +16,9 @@ use sea_orm::QuerySelect;
|
||||
use serde_json::json;
|
||||
use tokio::io::AsyncWriteExt;
|
||||
|
||||
use super::status::Status;
|
||||
use crate::bilibili::{FavoriteListInfo, PageInfo, VideoInfo};
|
||||
use crate::config::CONFIG;
|
||||
use crate::core::status::Status;
|
||||
|
||||
pub static TEMPLATE: Lazy<handlebars::Handlebars> = Lazy::new(|| {
|
||||
let mut handlebars = handlebars::Handlebars::new();
|
||||
|
||||
@@ -11,10 +11,10 @@ mod error;
|
||||
use env_logger::Env;
|
||||
use once_cell::sync::Lazy;
|
||||
|
||||
use self::bilibili::BiliClient;
|
||||
use self::config::CONFIG;
|
||||
use self::core::command::{process_favorite_list, SCAN_ONLY};
|
||||
use self::database::{database_connection, migrate_database};
|
||||
use crate::bilibili::BiliClient;
|
||||
use crate::config::CONFIG;
|
||||
use crate::core::command::{process_favorite_list, SCAN_ONLY};
|
||||
use crate::database::{database_connection, migrate_database};
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> ! {
|
||||
|
||||
Reference in New Issue
Block a user