File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -3,16 +3,18 @@ use regex::Regex;
3
3
use std:: process:: Command ;
4
4
5
5
pub fn get_media_info ( input : & str ) -> OutputMetadata {
6
- // TODO: Fix this so it works with . and - for date
7
- let re = Regex :: new ( r"(\d{4}-\d{2}-\d{2})?-(.*).(mp4)" ) . unwrap ( ) ;
6
+ let re = Regex :: new ( r"(\d{4}(?:-|\.)\d{2}(?:-|\.)\d{2})?(?:-|\.)*(.+).(mp4)" ) . unwrap ( ) ;
8
7
9
8
let captures = re. captures ( input) . expect ( "expect YYYY-MM-DD-File-Name.mp4" ) ;
10
9
11
- // println!("captures len {}", captures.len());
12
- // for cap in 0..captures.len() {
13
- // println!("cap: {}", cap);
14
- // println!("{}", format!("{}", captures.get(cap).unwrap().as_str()));
15
- // }
10
+ println ! ( "captures len {}" , captures. len( ) ) ;
11
+ for cap in 0 ..captures. len ( ) {
12
+ println ! (
13
+ "{}: {}" ,
14
+ cap,
15
+ format!( "{}" , captures. get( cap) . unwrap( ) . as_str( ) )
16
+ ) ;
17
+ }
16
18
17
19
// TODO: Make the date optional
18
20
// let mut date = "";
You can’t perform that action at this time.
0 commit comments