{"action":"created","comment":{"url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/pulls/comments/140664006","pull_request_review_id":64769493,"id":140664006,"diff_hunk":"@@ -203,13 +202,39 @@ def get_next_episode_for_show(self, show_id):\n     def unaired(self):\n         ''' get all unaired episodes for shows in the library - provided by tvdb module'''\n         self.metadatautils.thetvdb.days_ahead = 120\n-        episodes = self.metadatautils.thetvdb.get_kodi_unaired_episodes(False)[:self.options[\"limit\"]]\n+\n+        filters = [kodi_constants.FILTER_UNWATCHED]\n+        if self.options[\"next_inprogress_only\"]:\n+            filters = [kodi_constants.FILTER_INPROGRESS]\n+        if self.options.get(\"tag\"):\n+            filters.append({\"operator\": \"contains\", \"field\": \"tag\", \"value\": self.options[\"tag\"]})\n+        if self.options.get(\"path\"):\n+            filters.append({\"operator\": \"startswith\", \"field\": \"path\", \"value\": self.options[\"path\"]})\n+\n+        # First we get a list of all the inprogress/unwatched TV shows ordered by lastplayed\n+        all_shows = self.metadatautils.kodidb.tvshows(sort=kodi_constants.SORT_LASTPLAYED, filters=filters,\n+                                                      limits=(0, self.options[\"limit\"]))\n+        tvshows_ids = [d['tvshowid'] for d in all_shows]\n+        episodes = self.metadatautils.thetvdb.get_kodi_unaired_episodes(False, tvshows_ids)[:self.options[\"limit\"]]\n         return [self.map_episode_props(episode) for episode in episodes]\n \n     def nextaired(self, days_ahead=60):\n         ''' get all next airing episodes for shows in the library - provided by tvdb module'''\n         self.metadatautils.thetvdb.days_ahead = days_ahead\n-        episodes = self.metadatautils.thetvdb.get_kodi_unaired_episodes(True)\n+\n+        filters = [kodi_constants.FILTER_UNWATCHED]\n+        if self.options[\"next_inprogress_only\"]:\n+            filters = [kodi_constants.FILTER_INPROGRESS]\n+        if self.options.get(\"tag\"):\n+            filters.append({\"operator\": \"contains\", \"field\": \"tag\", \"value\": self.options[\"tag\"]})\n+        if self.options.get(\"path\"):\n+            filters.append({\"operator\": \"startswith\", \"field\": \"path\", \"value\": self.options[\"path\"]})\n+\n+        # First we get a list of all the inprogress/unwatched TV shows ordered by lastplayed\n+        all_shows = self.metadatautils.kodidb.tvshows(sort=kodi_constants.SORT_LASTPLAYED, filters=filters,\n+                                                      limits=(0, self.options[\"limit\"]))\n+        tvshows_ids = [d['tvshowid'] for d in all_shows]\n+        episodes = self.metadatautils.thetvdb.get_kodi_unaired_episodes(True, tvshows_ids)","path":"resources/lib/episodes.py","position":46,"original_position":46,"commit_id":"b3056ee76cd002bfdcb99741ab0c181e0216f489","original_commit_id":"a405b1a8e3d92664d64e791504f99196a4289554","user":{"login":"marcelveldt","id":6389780,"avatar_url":"https://avatars3.githubusercontent.com/u/6389780?v=4","gravatar_id":"","url":"https://api.github.com/users/marcelveldt","html_url":"https://github.com/marcelveldt","followers_url":"https://api.github.com/users/marcelveldt/followers","following_url":"https://api.github.com/users/marcelveldt/following{/other_user}","gists_url":"https://api.github.com/users/marcelveldt/gists{/gist_id}","starred_url":"https://api.github.com/users/marcelveldt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcelveldt/subscriptions","organizations_url":"https://api.github.com/users/marcelveldt/orgs","repos_url":"https://api.github.com/users/marcelveldt/repos","events_url":"https://api.github.com/users/marcelveldt/events{/privacy}","received_events_url":"https://api.github.com/users/marcelveldt/received_events","type":"User","site_admin":false},"body":"please change this line in \r\n\r\nepisodes = self.metadatautils.thetvdb.get_kodi_unaired_episodes(True, False, tvshows_ids)\r\n\r\nsee my comments in the PR for tvdb module","created_at":"2017-09-24T18:33:51Z","updated_at":"2017-09-24T18:36:08Z","html_url":"https://github.com/marcelveldt/script.skin.helper.widgets/pull/21#discussion_r140664006","pull_request_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/pulls/21","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/pulls/comments/140664006"},"html":{"href":"https://github.com/marcelveldt/script.skin.helper.widgets/pull/21#discussion_r140664006"},"pull_request":{"href":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/pulls/21","id":142574272,"html_url":"https://github.com/marcelveldt/script.skin.helper.widgets/pull/21","diff_url":"https://github.com/marcelveldt/script.skin.helper.widgets/pull/21.diff","patch_url":"https://github.com/marcelveldt/script.skin.helper.widgets/pull/21.patch","issue_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/issues/21","number":21,"state":"open","locked":false,"title":"added filter by path and tag to unaired and nextaired methods","user":{"login":"redglory","id":782452,"avatar_url":"https://avatars3.githubusercontent.com/u/782452?v=4","gravatar_id":"","url":"https://api.github.com/users/redglory","html_url":"https://github.com/redglory","followers_url":"https://api.github.com/users/redglory/followers","following_url":"https://api.github.com/users/redglory/following{/other_user}","gists_url":"https://api.github.com/users/redglory/gists{/gist_id}","starred_url":"https://api.github.com/users/redglory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redglory/subscriptions","organizations_url":"https://api.github.com/users/redglory/orgs","repos_url":"https://api.github.com/users/redglory/repos","events_url":"https://api.github.com/users/redglory/events{/privacy}","received_events_url":"https://api.github.com/users/redglory/received_events","type":"User","site_admin":false},"body":"Following the change in next episodes which can be filtered by path and tag parameters, I've applied same concept to nextairing and unaired episodes, which relie on the script.module.thetvdb module.\r\n\r\nAlso added pt_pt full translation .po","created_at":"2017-09-22T13:03:32Z","updated_at":"2017-09-24T18:36:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"88b740b0340b8df113636db3f82d81b4c28d1cc9","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/pulls/21/commits","review_comments_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/pulls/21/comments","review_comment_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/pulls/comments{/number}","comments_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/issues/21/comments","statuses_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/statuses/b3056ee76cd002bfdcb99741ab0c181e0216f489","head":{"label":"redglory:master","ref":"master","sha":"b3056ee76cd002bfdcb99741ab0c181e0216f489","user":{"login":"redglory","id":782452,"avatar_url":"https://avatars3.githubusercontent.com/u/782452?v=4","gravatar_id":"","url":"https://api.github.com/users/redglory","html_url":"https://github.com/redglory","followers_url":"https://api.github.com/users/redglory/followers","following_url":"https://api.github.com/users/redglory/following{/other_user}","gists_url":"https://api.github.com/users/redglory/gists{/gist_id}","starred_url":"https://api.github.com/users/redglory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redglory/subscriptions","organizations_url":"https://api.github.com/users/redglory/orgs","repos_url":"https://api.github.com/users/redglory/repos","events_url":"https://api.github.com/users/redglory/events{/privacy}","received_events_url":"https://api.github.com/users/redglory/received_events","type":"User","site_admin":false},"repo":{"id":104408474,"name":"script.skin.helper.widgets","full_name":"redglory/script.skin.helper.widgets","owner":{"login":"redglory","id":782452,"avatar_url":"https://avatars3.githubusercontent.com/u/782452?v=4","gravatar_id":"","url":"https://api.github.com/users/redglory","html_url":"https://github.com/redglory","followers_url":"https://api.github.com/users/redglory/followers","following_url":"https://api.github.com/users/redglory/following{/other_user}","gists_url":"https://api.github.com/users/redglory/gists{/gist_id}","starred_url":"https://api.github.com/users/redglory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redglory/subscriptions","organizations_url":"https://api.github.com/users/redglory/orgs","repos_url":"https://api.github.com/users/redglory/repos","events_url":"https://api.github.com/users/redglory/events{/privacy}","received_events_url":"https://api.github.com/users/redglory/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/redglory/script.skin.helper.widgets","description":"Widgets provided by Skinhelper","fork":true,"url":"https://api.github.com/repos/redglory/script.skin.helper.widgets","forks_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/forks","keys_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/keys{/key_id}","collaborators_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/teams","hooks_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/hooks","issue_events_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/issues/events{/number}","events_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/events","assignees_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/assignees{/user}","branches_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/branches{/branch}","tags_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/tags","blobs_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/git/refs{/sha}","trees_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/git/trees{/sha}","statuses_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/statuses/{sha}","languages_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/languages","stargazers_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/stargazers","contributors_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/contributors","subscribers_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/subscribers","subscription_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/subscription","commits_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/commits{/sha}","git_commits_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/git/commits{/sha}","comments_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/comments{/number}","issue_comment_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/issues/comments{/number}","contents_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/contents/{+path}","compare_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/compare/{base}...{head}","merges_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/merges","archive_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/downloads","issues_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/issues{/number}","pulls_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/pulls{/number}","milestones_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/milestones{/number}","notifications_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/labels{/name}","releases_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/releases{/id}","deployments_url":"https://api.github.com/repos/redglory/script.skin.helper.widgets/deployments","created_at":"2017-09-21T23:27:21Z","updated_at":"2017-09-21T23:27:23Z","pushed_at":"2017-09-22T17:49:35Z","git_url":"git://github.com/redglory/script.skin.helper.widgets.git","ssh_url":"git@github.com:redglory/script.skin.helper.widgets.git","clone_url":"https://github.com/redglory/script.skin.helper.widgets.git","svn_url":"https://github.com/redglory/script.skin.helper.widgets","homepage":null,"size":335,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"marcelveldt:master","ref":"master","sha":"7782500f300949ef6df1e5201ea692b7364426f7","user":{"login":"marcelveldt","id":6389780,"avatar_url":"https://avatars3.githubusercontent.com/u/6389780?v=4","gravatar_id":"","url":"https://api.github.com/users/marcelveldt","html_url":"https://github.com/marcelveldt","followers_url":"https://api.github.com/users/marcelveldt/followers","following_url":"https://api.github.com/users/marcelveldt/following{/other_user}","gists_url":"https://api.github.com/users/marcelveldt/gists{/gist_id}","starred_url":"https://api.github.com/users/marcelveldt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcelveldt/subscriptions","organizations_url":"https://api.github.com/users/marcelveldt/orgs","repos_url":"https://api.github.com/users/marcelveldt/repos","events_url":"https://api.github.com/users/marcelveldt/events{/privacy}","received_events_url":"https://api.github.com/users/marcelveldt/received_events","type":"User","site_admin":false},"repo":{"id":70829212,"name":"script.skin.helper.widgets","full_name":"marcelveldt/script.skin.helper.widgets","owner":{"login":"marcelveldt","id":6389780,"avatar_url":"https://avatars3.githubusercontent.com/u/6389780?v=4","gravatar_id":"","url":"https://api.github.com/users/marcelveldt","html_url":"https://github.com/marcelveldt","followers_url":"https://api.github.com/users/marcelveldt/followers","following_url":"https://api.github.com/users/marcelveldt/following{/other_user}","gists_url":"https://api.github.com/users/marcelveldt/gists{/gist_id}","starred_url":"https://api.github.com/users/marcelveldt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcelveldt/subscriptions","organizations_url":"https://api.github.com/users/marcelveldt/orgs","repos_url":"https://api.github.com/users/marcelveldt/repos","events_url":"https://api.github.com/users/marcelveldt/events{/privacy}","received_events_url":"https://api.github.com/users/marcelveldt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/marcelveldt/script.skin.helper.widgets","description":"Widgets provided by Skinhelper","fork":false,"url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets","forks_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/forks","keys_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/teams","hooks_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/hooks","issue_events_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/issues/events{/number}","events_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/events","assignees_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/assignees{/user}","branches_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/branches{/branch}","tags_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/tags","blobs_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/git/refs{/sha}","trees_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/statuses/{sha}","languages_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/languages","stargazers_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/stargazers","contributors_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/contributors","subscribers_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/subscribers","subscription_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/subscription","commits_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/commits{/sha}","git_commits_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/git/commits{/sha}","comments_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/comments{/number}","issue_comment_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/issues/comments{/number}","contents_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/contents/{+path}","compare_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/merges","archive_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/downloads","issues_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/issues{/number}","pulls_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/pulls{/number}","milestones_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/milestones{/number}","notifications_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/labels{/name}","releases_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/releases{/id}","deployments_url":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/deployments","created_at":"2016-10-13T17:05:55Z","updated_at":"2017-07-01T05:45:12Z","pushed_at":"2017-09-24T08:42:16Z","git_url":"git://github.com/marcelveldt/script.skin.helper.widgets.git","ssh_url":"git@github.com:marcelveldt/script.skin.helper.widgets.git","clone_url":"https://github.com/marcelveldt/script.skin.helper.widgets.git","svn_url":"https://github.com/marcelveldt/script.skin.helper.widgets","homepage":null,"size":332,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":9,"forks":12,"open_issues":9,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/pulls/21"},"html":{"href":"https://github.com/marcelveldt/script.skin.helper.widgets/pull/21"},"issue":{"href":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/issues/21"},"comments":{"href":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/marcelveldt/script.skin.helper.widgets/statuses/b3056ee76cd002bfdcb99741ab0c181e0216f489"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"marcelveldt"}}