Skip to content

Commit

Permalink
Add movies age in log
Browse files Browse the repository at this point in the history
  • Loading branch information
navilg committed Jun 3, 2023
1 parent b8ec986 commit 46571ce
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/radarr.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ func GetMovieImportEvents(movieId int) ([]MovieImportEvent, error) {
}

func MarkMoviesForDeletion(moviesdata []byte, moviesIgnored []string, isDryRun bool) ([]string, error) {
// fmt.Println("Entered function MarkMoviesForDeletion")
apiUrl := Config.Radarr.URL + "/api/" + apiVersion + "/movie/editor"
apiKey, err := Base64Decode(Config.Radarr.B64APIKey)
if err != nil {
Expand Down Expand Up @@ -232,6 +233,12 @@ func GetMovieAge(movie Movie) (*float64, error) {
durationInDays := now.Sub(parsedDateAdded).Hours() / 24
// fmt.Println(dateAdded, parsedDateAdded, durationInDays, movie.Tags)

// fmt.Println(movie.Title, dateAdded)
// fmt.Println(durationInDays)

movieAgeDetail, _ := json.Marshal(map[string]any{"Title": movie.Title, "AddedOn": dateAdded, "Age": fmt.Sprintf("%.1f", durationInDays) + " days"})
log.Println(string(movieAgeDetail))

return &durationInDays, nil
}

Expand Down

0 comments on commit 46571ce

Please sign in to comment.