Compare commits

...

10 commits
2.3.0 ... main

Author SHA1 Message Date
49de0ce13c
build: Bumped version to 2.3.2 2025-04-07 21:26:27 -05:00
cd0dbcd47b
build: Updated deps to mitigate an issue in tokio 2025-04-07 21:25:19 -05:00
3757dd0a47
fix: Improved compatibility of built package 2025-03-08 16:37:23 -06:00
cf8a9ee764
build: Bumped version to 2.3.1 2025-03-08 16:06:18 -06:00
80fdc110ae
fix: Adapt to changes in deps 2025-03-08 16:05:53 -06:00
c5b1f51233
build: Updated deps 2025-03-08 15:53:54 -06:00
Sayantan Santra
3e7b8fbd5d
Merge pull request #7 from SinTan1729/dependabot/cargo/h2-0.3.26
build(deps): bump h2 from 0.3.24 to 0.3.26
2024-04-05 11:47:00 -05:00
dependabot[bot]
f979559b50
build(deps): bump h2 from 0.3.24 to 0.3.26
Bumps [h2](https://github.com/hyperium/h2) from 0.3.24 to 0.3.26.
- [Release notes](https://github.com/hyperium/h2/releases)
- [Changelog](https://github.com/hyperium/h2/blob/v0.3.26/CHANGELOG.md)
- [Commits](https://github.com/hyperium/h2/compare/v0.3.24...v0.3.26)

---
updated-dependencies:
- dependency-name: h2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-05 16:18:23 +00:00
443c8e6cc9
new: Print some message when flags are set 2024-03-11 18:23:16 -05:00
4f3f349292
chg: Slightly modified the manpage 2024-03-08 10:45:04 -06:00
6 changed files with 1018 additions and 441 deletions

1425
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
[package]
name = "movie-rename"
version = "2.3.0"
version = "2.3.2"
build = "build.rs"
edition = "2021"
authors = ["Sayantan Santra <sayantan[dot]santra689[at]gmail[dot]com"]
@ -17,8 +17,8 @@ categories = ["command-line-utilities"]
[dependencies]
torrent-name-parser = "0.12.1"
tmdb-api = "0.5.0"
inquire = "0.6.2"
tmdb-api = "0.8.0"
inquire = "0.7.5"
load_file = "1.0.1"
tokio = { version = "1.32.0", features = ["macros", "rt-multi-thread"] }
clap = { version = "4.5.1", features = ["cargo"] }

View file

@ -2,7 +2,7 @@ PREFIX := /usr/local
PKGNAME := movie-rename
build:
cargo build --release
cargo zigbuild --release --target x86_64-unknown-linux-gnu.2.34
build-debug:
cargo build
@ -19,6 +19,6 @@ uninstall:
rm -f "$(DESTDIR)$(PREFIX)/man/man1/$(PKGNAME).1"
aur: build
tar --transform 's/.*\///g' -czf $(PKGNAME).tar.gz target/release/$(PKGNAME) target/autocomplete/* $(PKGNAME).1
tar --transform 's/.*\///g' -czf $(PKGNAME).tar.gz target/x86_64-unknown-linux-gnu/release/$(PKGNAME) target/autocomplete/* $(PKGNAME).1
.PHONY: build build-debug install clean uninstall aur

View file

@ -17,9 +17,6 @@ Performs a dry run, without actually renaming anything.
-d, --directory
Runs in directory mode. In this mode, it is assumed that the arguments are directory names, which contain exactly one movie and optionally subtitles.
.TP
-dn, -nd
Performs a dry run in directory mode.
.TP
-h, --help
Print help information.
.TP

View file

@ -4,9 +4,9 @@ use inquire::{
};
use std::{collections::HashMap, fs, path::Path};
use tmdb_api::{
client::{reqwest::ReqwestExecutor, Client},
movie::{credits::MovieCredits, search::MovieSearch},
prelude::Command,
Client,
};
use torrent_name_parser::Metadata;
@ -15,7 +15,7 @@ use crate::structs::{get_long_lang, Language, MovieEntry};
// Function to process movie entries
pub async fn process_file(
filename: &String,
tmdb: &Client,
tmdb: &Client<ReqwestExecutor>,
pattern: &str,
dry_run: bool,
lucky: bool,
@ -206,7 +206,7 @@ pub async fn process_file(
}
// RenderConfig for the menu items
fn get_render_config() -> RenderConfig {
fn get_render_config() -> RenderConfig<'static> {
let mut render_config = RenderConfig::default();
render_config.option_index_prefix = IndexPrefix::Simple;

View file

@ -1,6 +1,6 @@
use load_file::{self, load_str};
use std::{collections::HashMap, env, fs, path::Path, process::exit};
use tmdb_api::Client;
use tmdb_api::client::{reqwest::ReqwestExecutor, Client};
// Import all the modules
mod functions;
@ -16,6 +16,17 @@ async fn main() {
let flag_directory = settings["directory"];
let flag_lucky = settings["i-feel-lucky"];
// Print some message when flags are set.
if flag_dry_run {
println!("Doing a dry run. No files will be modified.")
}
if flag_directory {
println!("Running in directory mode...")
}
if flag_lucky {
println!("Automatically selecting the first entry...")
}
// Try to read config file, or display error
let mut config_file = env::var("XDG_CONFIG_HOME").unwrap_or(String::from("$HOME"));
if config_file == "$HOME" {
@ -39,7 +50,7 @@ async fn main() {
}
// Create TMDb object for API calls
let tmdb = Client::new(String::from(api_key));
let tmdb = Client::<ReqwestExecutor>::new(String::from(api_key));
// Iterate over entries
for entry in entries {