package Ġcom . rich ode mus . reader Ċ Ċ import Ġcom . rich ode mus . reader . youtube _ feed _ service . Periodic Download Orche strator Ċ import Ġis LoggedIn Ċ import Ġorg . springframework . http . HttpStatus . FOR BID DEN Ċ import Ġorg . springframework . http . Response Entity Ċ import Ġorg . springframework . web . bind . annotation . Cross Origin Ċ import Ġorg . springframework . web . bind . annotation . GetMapping Ċ import Ġorg . springframework . web . bind . annotation . PostMapping Ċ import Ġorg . springframework . web . bind . annotation . RestController Ċ import Ġjava . time . LocalDateTime Ċ import Ġjavax . servlet . http . Http Session Ċ Ċ @ Cross Origin ( ĊĠĠĠĠĠĠĠ Ġorig ins Ġ= Ġ[" http :// localhost : 8 0 8 0 ", Ġ" https :// reader . rich ode mus . com "], ĊĠĠĠĠĠĠĠ Ġmax Age Ġ= Ġ 3 6 0 0 , ĊĠĠĠĠĠĠĠ Ġallow Credentials Ġ= Ġ" true " Ċ ) Ċ @ RestController Ċ internal Ġclass ĠAdmin Controller ( ĊĠĠĠĠĠĠĠ Ġprivate Ġval Ġperiodic Download Orche strator : ĠPeriod ic Download Orche strator Ċ ) Ġ{ ĊĊĠĠĠ Ġ@ Suppress (" unused ") ĊĠĠĠ Ġ@ GetMapping (" v 1 / admin / download ") ĊĠĠĠ Ġinternal Ġfun ĠgetStatus (): ĠResponseEntity < Download JobStatus > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠResponseEntity . ok ( Download JobStatus ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġperiodic Download Orche strator . last Run (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġperiodic Download Orche strator . isRunning , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġperiodic Download Orche strator . last Run Out Come () ĊĠĠĠĠĠĠĠ Ġ)) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġdata Ġclass ĠDownload JobStatus ( val Ġlast Run : ĠLocalDateTime , Ġval Ġrunning : ĠBoolean , Ġval Ġlast Run Out Come : ĠString ) ĊĊĠĠĠ Ġ@ Suppress (" unused ") ĊĠĠĠ Ġ@ PostMapping (" v 1 / admin / download ") ĊĠĠĠ Ġinternal Ġfun Ġdownload ( session : ĠHttp Session ): ĠResponseEntity < String > Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ(! session . is LoggedIn ()) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĠResponseEntity ( FOR BID DEN ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġperiodic Download Orche strator . download Everything Once () ĊĠĠĠĠĠĠĠ Ġreturn ĠResponseEntity . ok ("\" OK \" ") ĊĠĠĠ Ġ} Ċ } Ċ