Skip to content

Commit

Permalink
Merge pull request #7 from Migz93/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Migz93 authored Jan 28, 2024
2 parents 8fa5ff6 + 2debd4a commit cea1055
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
11 changes: 11 additions & 0 deletions pvr/radarrv4.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,18 @@ func (p *RadarrV4) GetWantedCutoff() ([]MediaItem, error) {
continue
}

//lets find the highest date.
airDate := movie.AirDateUtc

// Compare and update if necessary
if !movie.PhysicalUtc.IsZero() && movie.PhysicalUtc.After(airDate) {
airDate = movie.PhysicalUtc
}

if !movie.DigitalUtc.IsZero() && movie.DigitalUtc.After(airDate) {
airDate = movie.DigitalUtc
}

wantedCutoff = append(wantedCutoff, MediaItem{
ItemId: movie.Id,
AirDateUtc: airDate,
Expand Down
11 changes: 11 additions & 0 deletions pvr/radarrv5.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,18 @@ func (p *RadarrV5) GetWantedCutoff() ([]MediaItem, error) {
continue
}

//lets find the highest date.
airDate := movie.AirDateUtc

// Compare and update if necessary
if !movie.PhysicalUtc.IsZero() && movie.PhysicalUtc.After(airDate) {
airDate = movie.PhysicalUtc
}

if !movie.DigitalUtc.IsZero() && movie.DigitalUtc.After(airDate) {
airDate = movie.DigitalUtc
}

wantedCutoff = append(wantedCutoff, MediaItem{
ItemId: movie.Id,
AirDateUtc: airDate,
Expand Down
10 changes: 7 additions & 3 deletions pvr/whisparrv2.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type WhisparrV2Queue struct {

type WhisparrV2Episode struct {
Id int
AirDateUtc time.Time
AirDateUtc string `json:"releaseDate"`
Monitored bool
}

Expand Down Expand Up @@ -235,7 +235,11 @@ func (p *WhisparrV2) GetWantedMissing() ([]MediaItem, error) {
for _, episode := range m.Records {

// store this episode
airDate := episode.AirDateUtc
//extraDate := "T00:00:00Z"
//airDate := episode.AirDateUtc

airDate, _ := time.Parse("2006-01-02", episode.AirDateUtc)
//airDateNew := airDate+extraDate
wantedMissing = append(wantedMissing, MediaItem{
ItemId: episode.Id,
AirDateUtc: airDate,
Expand Down Expand Up @@ -308,7 +312,7 @@ func (p *WhisparrV2) GetWantedCutoff() ([]MediaItem, error) {
lastPageSize = len(m.Records)
for _, episode := range m.Records {
// store this episode
airDate := episode.AirDateUtc
airDate, _ := time.Parse("2006-01-02", episode.AirDateUtc)
wantedCutoff = append(wantedCutoff, MediaItem{
ItemId: episode.Id,
AirDateUtc: airDate,
Expand Down

0 comments on commit cea1055

Please sign in to comment.