Skip to content

Commit

Permalink
Merge pull request #603 from dularion/main/AE/improve-error-for-movie…
Browse files Browse the repository at this point in the history
…DB-limit-bulk

improve error for movie db limit bulk
  • Loading branch information
dularion authored Apr 5, 2018
2 parents c99bd2d + 5e9b15e commit 9542621
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
<span ng-if="vm.getMatchForPath(file.path) && vm.getMatchForPath(file.path).status == 0">
{{vm.getMatchForPath(file.path).message}}
</span>
<span class="text-danger" ng-if="vm.getMatchForPath(file.path) && vm.getMatchForPath(file.path).status == 4">
TheMovieDB Limit reached
</span>

<br>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<div class="modal-body">
<legend>
Episode
Episode &nbsp;<span ng-if="episode.id" class="text-muted text-sm">(id: {{episode.id}})</span>
</legend>

<div class="form-group">
Expand Down
1 change: 1 addition & 0 deletions grails-app/controllers/streama/TheMovieDbController.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class TheMovieDbController {
if(Episode.findByShowAndSeason_numberAndEpisode_numberAndDeletedNotEqual(tvShow, season, episodeData.episode_number, true)){
return
}
episodeData.apiId = episodeData.id
result.add(episodeData)
}

Expand Down
5 changes: 4 additions & 1 deletion grails-app/services/streama/BulkCreateService.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class BulkCreateService {
NO_MATCH: 0,
MATCH_FOUND: 1,
EXISTING: 2,
CREATED: 3
CREATED: 3,
LIMIT_REACHED: 4
]
final static STREAMA_ROUTES = [
movie: 'movie',
Expand Down Expand Up @@ -91,6 +92,7 @@ class BulkCreateService {
}
} catch (Exception ex) {
log.error("Error occured while trying to retrieve data from TheMovieDB. Please check your API-Key.")
fileResult.status = MATCHER_STATUS.LIMIT_REACHED
fileResult.title = name
}
fileResult.status = fileResult.status ?: MATCHER_STATUS.MATCH_FOUND
Expand Down Expand Up @@ -149,6 +151,7 @@ class BulkCreateService {
}
} catch (Exception ex) {
log.error("Error occured while trying to retrieve data from TheMovieDB. Please check your API-Key.")
fileResult.status = MATCHER_STATUS.LIMIT_REACHED
fileResult.name = name
}
fileResult.status = fileResult.status ?: MATCHER_STATUS.MATCH_FOUND
Expand Down

0 comments on commit 9542621

Please sign in to comment.