@@ -45,7 +45,14 @@ fn main() {
45
45
Actions :: Autotagger { path, .. } => {
46
46
let config = action. get_at_config ( ) . expect ( "Failed loading config file!" ) ;
47
47
debug ! ( "{:?}" , config) ;
48
- let files = AudioFileInfo :: get_file_list ( & path, config. include_subfolders ) ;
48
+
49
+ // Get files
50
+ let files = if path. is_file ( ) {
51
+ onetagger_playlist:: get_files_from_playlist_file ( path) . expect ( "Not a valid playlist file" )
52
+ } else {
53
+ AudioFileInfo :: get_file_list ( & path, config. include_subfolders )
54
+ } ;
55
+
49
56
let rx = Tagger :: tag_files ( & config, files, Arc :: new ( Mutex :: new ( None ) ) ) ;
50
57
let start = timestamp ! ( ) ;
51
58
for status in rx {
@@ -64,7 +71,14 @@ fn main() {
64
71
// Auth spotify
65
72
let spotify = Spotify :: try_cached_token ( client_id, client_secret)
66
73
. expect ( "Spotify unauthorized, please run the authorize-spotify option or login to Spotify in UI at least once!" ) ;
67
- let files = AudioFileInfo :: get_file_list ( & path, subfolders) ;
74
+
75
+ // Get files
76
+ let files = if path. is_file ( ) {
77
+ onetagger_playlist:: get_files_from_playlist_file ( path) . expect ( "Not a valid playlist file" )
78
+ } else {
79
+ AudioFileInfo :: get_file_list ( & path, subfolders)
80
+ } ;
81
+
68
82
let rx = AudioFeatures :: start_tagging ( config, spotify, files) ;
69
83
let start = timestamp ! ( ) ;
70
84
for status in rx {
0 commit comments