@@ -19,8 +19,8 @@ use unstable::UnstableCommand;
1919use crate :: models:: cli:: interzic:: InterzicCommand ;
2020#[ cfg( feature = "radio" ) ]
2121use crate :: models:: cli:: radio:: RadioCommand ;
22- use crate :: tools:: bumps :: bump_command ;
23- use crate :: tools:: bumps :: bump_down_command ;
22+ use crate :: tools:: bump :: BumpCommand ;
23+ use crate :: tools:: bump :: bump_down :: BumpDownCommand ;
2424use crate :: tools:: cache:: CacheCommand ;
2525use crate :: tools:: compatibility:: compatibility_command;
2626use crate :: tools:: daily:: DailyCommand ;
@@ -90,38 +90,16 @@ impl Cli {
9090 }
9191}
9292
93- /// bump a recording to show up more frequently in radios that uses scores. By default, it uses the lastest listen as target.
94- ///
95- /// bump-down is an alias for `bump <RECORDING> <DURATION> 0.9`
96- ///
97- /// All the bumps are added multiplicatively, so a recording won't disapear. Use the blacklist to remove them.
98- #[ derive( Parser , Debug , Clone ) ]
99- pub struct BumpCLI {
100- /// The recording to bump
101- pub recording : Option < String > ,
102-
103- /// The duration the bump last for (Default: 3 months)
104- #[ arg( short, long) ]
105- pub duration : Option < String > ,
106-
107- /// The multiplier added to the score (Default: 1.1)
108- #[ arg( short, long) ]
109- pub multiplier : Option < String > ,
110-
111- #[ arg( short, long) ]
112- pub username : Option < String > ,
113- }
114-
11593#[ derive( Subcommand , Debug , Clone ) ]
11694pub enum Commands {
117- Bump ( BumpCLI ) ,
95+ Bump ( BumpCommand ) ,
11896
11997 /// bump a recording to show up more frequently in radios that uses scores. By default, it uses the lastest listen as target.
12098 ///
12199 /// bump-down is an alias for `bump <RECORDING> <DURATION> 0.9`
122100 ///
123101 /// All the bumps are added multiplicatively, so a recording won't disapear. Use the blacklist to remove them.
124- BumpDown ( BumpCLI ) ,
102+ BumpDown ( BumpDownCommand ) ,
125103
126104 /// Commands to deal with the local cache
127105 Cache ( CacheCommand ) ,
@@ -176,6 +154,8 @@ pub enum Commands {
176154impl Commands {
177155 pub async fn run ( & self , conn : & mut sqlx:: SqliteConnection ) -> Result < ( ) , FatalError > {
178156 match self {
157+ Self :: Bump ( val) => val. run ( ) . await ,
158+ Self :: BumpDown ( val) => val. run ( ) . await ,
179159 Self :: Cache ( val) => val. run ( ) . await ,
180160
181161 #[ cfg( feature = "stats" ) ]
@@ -207,11 +187,6 @@ impl Commands {
207187
208188 #[ cfg( feature = "interzicf" ) ]
209189 Self :: Playlist ( val) => val. run ( conn) . await ?,
210-
211- Self :: Bump ( val) => bump_command ( conn, val. clone ( ) ) . await ,
212-
213- Self :: BumpDown ( val) => bump_down_command ( conn, val. clone ( ) ) . await ,
214-
215190 Self :: Unstable ( val) => val. command . run ( conn) . await ,
216191 }
217192
0 commit comments