aboutsummaryrefslogtreecommitdiff
path: root/import/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'import/src/main.rs')
-rw-r--r--import/src/main.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/import/src/main.rs b/import/src/main.rs
index 26899bb..5d5e715 100644
--- a/import/src/main.rs
+++ b/import/src/main.rs
@@ -21,6 +21,7 @@ use jellyremuxer::import::{import_metadata, seek_index};
use log::{info, warn};
use rand::random;
use std::{
+ collections::BTreeMap,
fs::{remove_file, File},
io::{stdin, Write},
path::PathBuf,
@@ -306,17 +307,17 @@ fn main() -> anyhow::Result<()> {
.flatten();
}
- let mut ratings = Vec::new();
+ let mut ratings = BTreeMap::new();
ratings.extend(
infojson
.as_ref()
- .map(|i| Rating::YoutubeViews(i.view_count)),
+ .map(|i| (Rating::YoutubeViews, i.view_count as f64)),
);
ratings.extend(
infojson
.as_ref()
- .map(|i| i.like_count.map(Rating::YoutubeLikes))
+ .map(|i| i.like_count.map(|l| (Rating::YoutubeLikes, l as f64)))
.flatten(),
);