We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Incorrect timeframe plugin behaviour when loading items from an entry_list
### Expected behaviour:
The 1080p is downloaded

### Actual behaviour:
The plugin ignores 1080p and sees only 720p

### Steps to reproduce:
- Step 1: Add movies from rss http://rutor.info/rss.php?cat=7 to list movies_list

#### Config:
```
schedules:
  - tasks: ["download *"]
    interval:
      minutes: 15

web_server: yes

tasks:
  download good movies:
    entry_list: movies_list
    seen_movies:
      scope: local
    seen: local
    seen_info_hash: local
    timeframe:
      wait: 14 day
      on_reached: do_nothing
      target: 1080p
    priority: 5
    imdb:
      min_score: 6.3
      min_votes: 1000
      reject_genres:
        - documentary
        - musical
        - music
        - history
        - biography
        - war
    list_remove:
      - entry_list: movies_list
    download: /downloads
```
  
#### Log:
<details>
 <summary>(click to expand)</summary>

```
2018-10-26 09:16 VERBOSE  task          download good movies REJECTED: `Incredibles 2 (2018) WEB-DL 720p от селезень | iTunes` by timeframe plugin because timeframe waiting
2018-10-26 09:16 VERBOSE  task          download good movies REJECTED: `Incredibles 2 (2018) WEB-DL 1080p от TeamHD | iTunes` by timeframe plugin because timeframe waiting
2018-10-26 09:16 INFO     timeframe     download good movies `incredibles 2 2018`: timeframe waiting for 321h:59min. Currently best is `Incredibles 2 (2018) WEB-DL 720p от селезень | iTunes`.
```

<details><summary>--dump output excerpt</summary>
720p:

```
title            : Incredibles 2 (2018) WEB-DL 720p от селезень | iTunes
url              : http://d.rutor.is/download.php?rss=661218
original_url     : http://d.rutor.is/download.php?rss=661218
accepted_by      : imdb
content-length   : 82000
content_files    : [Incredibles.2.2018.720p.WEB-DL.selezen.mkv]
content_size     : 4012.526089668274
description      : Мультипликация
filename         : [rutor.is]Incredibles.2.2018.720p.WEB-DL.selezen.mkv.torrent
id               : incredibles 2 2018
imdb_id          : tt3606756
quality          : 720p webdl
reason           : timeframe waiting
rejected_by      : timeframe
```

1080p:
```
title            : Incredibles 2 (2018) WEB-DL 1080p от TeamHD | iTunes
url              : http://d.rutor.is/download.php?rss=661219
original_url     : http://d.rutor.is/download.php?rss=661219
accepted_by      : imdb
content-length   : 90640
content_files    : [Incredibles.2.2018.1080p.WEB-DL.TeamHD.mkv]
content_size     : 4444.096870422363
description      : Мультипликация
filename         : [rutor.is]Incredibles.2.2018.1080p.WEB-DL.TeamHD.mkv.torrent
id               : incredibles 2 2018
imdb_id          : tt3606756
quality          : 1080p webdl
raw_title        : Суперсемейка 2 / Incredibles 2 (2018) WEB-DL 1080p от TeamHD | iTunes
reason           : timeframe waiting
rejected_by      : timeframe
```

</details>
</details>

### Additional information:

- FlexGet version: 2.17.5 (first time noticed on 2.17.0, but probably is here for long time)
- Python version: 3.5.3
- Installation method: pip3 install (+docker)
- Using daemon (yes/no): yes
- OS and version: Debian Stretch
Incorrect timeframe plugin behaviour when loading items from an entry_list
### Expected behaviour:
The 1080p is downloaded

### Actual behaviour:
The plugin ignores 1080p and sees only 720p

### Steps to reproduce:
- Step 1: Add movies from rss http://rutor.info/rss.php?cat=7 to list movies_list

#### Config:
```
schedules:
  - tasks: ["download *"]
    interval:
      minutes: 15

web_server: yes

tasks:
  download good movies:
    entry_list: movies_list
    seen_movies:
      scope: local
    seen: local
    seen_info_hash: local
    timeframe:
      wait: 14 day
      on_reached: do_nothing
      target: 1080p
    priority: 5
    imdb:
      min_score: 6.3
      min_votes: 1000
      reject_genres:
        - documentary
        - musical
        - music
        - history
        - biography
        - war
    list_remove:
      - entry_list: movies_list
    download: /downloads
```
  
#### Log:
<details>
 <summary>(click to expand)</summary>

```
2018-10-26 09:16 VERBOSE  task          download good movies REJECTED: `Incredibles 2 (2018) WEB-DL 720p от селезень | iTunes` by timeframe plugin because timeframe waiting
2018-10-26 09:16 VERBOSE  task          download good movies REJECTED: `Incredibles 2 (2018) WEB-DL 1080p от TeamHD | iTunes` by timeframe plugin because timeframe waiting
2018-10-26 09:16 INFO     timeframe     download good movies `incredibles 2 2018`: timeframe waiting for 321h:59min. Currently best is `Incredibles 2 (2018) WEB-DL 720p от селезень | iTunes`.
```

<details><summary>--dump output excerpt</summary>
720p:

```
title            : Incredibles 2 (2018) WEB-DL 720p от селезень | iTunes
url              : http://d.rutor.is/download.php?rss=661218
original_url     : http://d.rutor.is/download.php?rss=661218
accepted_by      : imdb
content-length   : 82000
content_files    : [Incredibles.2.2018.720p.WEB-DL.selezen.mkv]
content_size     : 4012.526089668274
description      : Мультипликация
filename         : [rutor.is]Incredibles.2.2018.720p.WEB-DL.selezen.mkv.torrent
id               : incredibles 2 2018
imdb_id          : tt3606756
quality          : 720p webdl
reason           : timeframe waiting
rejected_by      : timeframe
```

1080p:
```
title            : Incredibles 2 (2018) WEB-DL 1080p от TeamHD | iTunes
url              : http://d.rutor.is/download.php?rss=661219
original_url     : http://d.rutor.is/download.php?rss=661219
accepted_by      : imdb
content-length   : 90640
content_files    : [Incredibles.2.2018.1080p.WEB-DL.TeamHD.mkv]
content_size     : 4444.096870422363
description      : Мультипликация
filename         : [rutor.is]Incredibles.2.2018.1080p.WEB-DL.TeamHD.mkv.torrent
id               : incredibles 2 2018
imdb_id          : tt3606756
quality          : 1080p webdl
raw_title        : Суперсемейка 2 / Incredibles 2 (2018) WEB-DL 1080p от TeamHD | iTunes
reason           : timeframe waiting
rejected_by      : timeframe
```

</details>
</details>

### Additional information:

- FlexGet version: 2.17.5 (first time noticed on 2.17.0, but probably is here for long time)
- Python version: 3.5.3
- Installation method: pip3 install (+docker)
- Using daemon (yes/no): yes
- OS and version: Debian Stretch

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `flexget/plugins/metainfo/quality.py`
Content:
```
1 from __future__ import unicode_literals, division, absolute_import
2 from builtins import *  # noqa pylint: disable=unused-import, redefined-builtin
3 
4 import logging
5 
6 from flexget import plugin
7 from flexget.event import event
8 from flexget.utils import qualities
9 
10 log = logging.getLogger('metainfo_quality')
11 
12 
13 class MetainfoQuality(object):
14     """
15     Utility:
16 
17     Set quality attribute for entries.
18     """
19 
20     schema = {'type': 'boolean'}
21 
22     @plugin.priority(127)  # Run after other plugins that might fill quality (series)
23     def on_task_metainfo(self, task, config):
24         # check if disabled (value set to false)
25         if config is False:
26             return
27         for entry in task.entries:
28             entry.register_lazy_func(self.get_quality, ['quality'])
29 
30     def get_quality(self, entry):
31         if entry.get('quality', eval_lazy=False):
32             log.debug('Quality is already set to %s for %s, skipping quality detection.' %
33                       (entry['quality'], entry['title']))
34             return
35         entry['quality'] = qualities.Quality(entry['title'])
36         if entry['quality']:
37             log.trace('Found quality %s for %s' % (entry['quality'], entry['title']))
38 
39 
40 @event('plugin.register')
41 def register_plugin():
42     plugin.register(MetainfoQuality, 'metainfo_quality', api_ver=2, builtin=True)
43
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/flexget/plugins/metainfo/quality.py b/flexget/plugins/metainfo/quality.py
--- a/flexget/plugins/metainfo/quality.py
+++ b/flexget/plugins/metainfo/quality.py
@@ -25,7 +25,12 @@
         if config is False:
             return
         for entry in task.entries:
-            entry.register_lazy_func(self.get_quality, ['quality'])
+            if isinstance(entry.get('quality', eval_lazy=False), str):
+                log.debug('Quality is already set to %s for %s, but has not been instantiated properly.' %
+                          (entry['quality'], entry['title']))
+                entry['quality'] = qualities.Quality(entry.get('quality', eval_lazy=False))
+            else:
+                entry.register_lazy_func(self.get_quality, ['quality'])
 
     def get_quality(self, entry):
         if entry.get('quality', eval_lazy=False):

{"golden_diff": "diff --git a/flexget/plugins/metainfo/quality.py b/flexget/plugins/metainfo/quality.py\n--- a/flexget/plugins/metainfo/quality.py\n+++ b/flexget/plugins/metainfo/quality.py\n@@ -25,7 +25,12 @@\n         if config is False:\n             return\n         for entry in task.entries:\n-            entry.register_lazy_func(self.get_quality, ['quality'])\n+            if isinstance(entry.get('quality', eval_lazy=False), str):\n+                log.debug('Quality is already set to %s for %s, but has not been instantiated properly.' %\n+                          (entry['quality'], entry['title']))\n+                entry['quality'] = qualities.Quality(entry.get('quality', eval_lazy=False))\n+            else:\n+                entry.register_lazy_func(self.get_quality, ['quality'])\n \n     def get_quality(self, entry):\n         if entry.get('quality', eval_lazy=False):\n", "issue": "Incorrect timeframe plugin behaviour when loading items from an entry_list\n### Expected behaviour:\r\nThe 1080p is downloaded\r\n\r\n### Actual behaviour:\r\nThe plugin ignores 1080p and sees only 720p\r\n\r\n### Steps to reproduce:\r\n- Step 1: Add movies from rss http://rutor.info/rss.php?cat=7 to list movies_list\r\n\r\n#### Config:\r\n```\r\nschedules:\r\n  - tasks: [\"download *\"]\r\n    interval:\r\n      minutes: 15\r\n\r\nweb_server: yes\r\n\r\ntasks:\r\n  download good movies:\r\n    entry_list: movies_list\r\n    seen_movies:\r\n      scope: local\r\n    seen: local\r\n    seen_info_hash: local\r\n    timeframe:\r\n      wait: 14 day\r\n      on_reached: do_nothing\r\n      target: 1080p\r\n    priority: 5\r\n    imdb:\r\n      min_score: 6.3\r\n      min_votes: 1000\r\n      reject_genres:\r\n        - documentary\r\n        - musical\r\n        - music\r\n        - history\r\n        - biography\r\n        - war\r\n    list_remove:\r\n      - entry_list: movies_list\r\n    download: /downloads\r\n```\r\n  \r\n#### Log:\r\n<details>\r\n <summary>(click to expand)</summary>\r\n\r\n```\r\n2018-10-26 09:16 VERBOSE  task          download good movies REJECTED: `Incredibles 2 (2018) WEB-DL 720p \u043e\u0442 \u0441\u0435\u043b\u0435\u0437\u0435\u043d\u044c | iTunes` by timeframe plugin because timeframe waiting\r\n2018-10-26 09:16 VERBOSE  task          download good movies REJECTED: `Incredibles 2 (2018) WEB-DL 1080p \u043e\u0442 TeamHD | iTunes` by timeframe plugin because timeframe waiting\r\n2018-10-26 09:16 INFO     timeframe     download good movies `incredibles 2 2018`: timeframe waiting for 321h:59min. Currently best is `Incredibles 2 (2018) WEB-DL 720p \u043e\u0442 \u0441\u0435\u043b\u0435\u0437\u0435\u043d\u044c | iTunes`.\r\n```\r\n\r\n<details><summary>--dump output excerpt</summary>\r\n720p:\r\n\r\n```\r\ntitle            : Incredibles 2 (2018) WEB-DL 720p \u043e\u0442 \u0441\u0435\u043b\u0435\u0437\u0435\u043d\u044c | iTunes\r\nurl              : http://d.rutor.is/download.php?rss=661218\r\noriginal_url     : http://d.rutor.is/download.php?rss=661218\r\naccepted_by      : imdb\r\ncontent-length   : 82000\r\ncontent_files    : [Incredibles.2.2018.720p.WEB-DL.selezen.mkv]\r\ncontent_size     : 4012.526089668274\r\ndescription      : \u041c\u0443\u043b\u044c\u0442\u0438\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044f\r\nfilename         : [rutor.is]Incredibles.2.2018.720p.WEB-DL.selezen.mkv.torrent\r\nid               : incredibles 2 2018\r\nimdb_id          : tt3606756\r\nquality          : 720p webdl\r\nreason           : timeframe waiting\r\nrejected_by      : timeframe\r\n```\r\n\r\n1080p:\r\n```\r\ntitle            : Incredibles 2 (2018) WEB-DL 1080p \u043e\u0442 TeamHD | iTunes\r\nurl              : http://d.rutor.is/download.php?rss=661219\r\noriginal_url     : http://d.rutor.is/download.php?rss=661219\r\naccepted_by      : imdb\r\ncontent-length   : 90640\r\ncontent_files    : [Incredibles.2.2018.1080p.WEB-DL.TeamHD.mkv]\r\ncontent_size     : 4444.096870422363\r\ndescription      : \u041c\u0443\u043b\u044c\u0442\u0438\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044f\r\nfilename         : [rutor.is]Incredibles.2.2018.1080p.WEB-DL.TeamHD.mkv.torrent\r\nid               : incredibles 2 2018\r\nimdb_id          : tt3606756\r\nquality          : 1080p webdl\r\nraw_title        : \u0421\u0443\u043f\u0435\u0440\u0441\u0435\u043c\u0435\u0439\u043a\u0430 2 / Incredibles 2 (2018) WEB-DL 1080p \u043e\u0442 TeamHD | iTunes\r\nreason           : timeframe waiting\r\nrejected_by      : timeframe\r\n```\r\n\r\n</details>\r\n</details>\r\n\r\n### Additional information:\r\n\r\n- FlexGet version: 2.17.5 (first time noticed on 2.17.0, but probably is here for long time)\r\n- Python version: 3.5.3\r\n- Installation method: pip3 install (+docker)\r\n- Using daemon (yes/no): yes\r\n- OS and version: Debian Stretch\nIncorrect timeframe plugin behaviour when loading items from an entry_list\n### Expected behaviour:\r\nThe 1080p is downloaded\r\n\r\n### Actual behaviour:\r\nThe plugin ignores 1080p and sees only 720p\r\n\r\n### Steps to reproduce:\r\n- Step 1: Add movies from rss http://rutor.info/rss.php?cat=7 to list movies_list\r\n\r\n#### Config:\r\n```\r\nschedules:\r\n  - tasks: [\"download *\"]\r\n    interval:\r\n      minutes: 15\r\n\r\nweb_server: yes\r\n\r\ntasks:\r\n  download good movies:\r\n    entry_list: movies_list\r\n    seen_movies:\r\n      scope: local\r\n    seen: local\r\n    seen_info_hash: local\r\n    timeframe:\r\n      wait: 14 day\r\n      on_reached: do_nothing\r\n      target: 1080p\r\n    priority: 5\r\n    imdb:\r\n      min_score: 6.3\r\n      min_votes: 1000\r\n      reject_genres:\r\n        - documentary\r\n        - musical\r\n        - music\r\n        - history\r\n        - biography\r\n        - war\r\n    list_remove:\r\n      - entry_list: movies_list\r\n    download: /downloads\r\n```\r\n  \r\n#### Log:\r\n<details>\r\n <summary>(click to expand)</summary>\r\n\r\n```\r\n2018-10-26 09:16 VERBOSE  task          download good movies REJECTED: `Incredibles 2 (2018) WEB-DL 720p \u043e\u0442 \u0441\u0435\u043b\u0435\u0437\u0435\u043d\u044c | iTunes` by timeframe plugin because timeframe waiting\r\n2018-10-26 09:16 VERBOSE  task          download good movies REJECTED: `Incredibles 2 (2018) WEB-DL 1080p \u043e\u0442 TeamHD | iTunes` by timeframe plugin because timeframe waiting\r\n2018-10-26 09:16 INFO     timeframe     download good movies `incredibles 2 2018`: timeframe waiting for 321h:59min. Currently best is `Incredibles 2 (2018) WEB-DL 720p \u043e\u0442 \u0441\u0435\u043b\u0435\u0437\u0435\u043d\u044c | iTunes`.\r\n```\r\n\r\n<details><summary>--dump output excerpt</summary>\r\n720p:\r\n\r\n```\r\ntitle            : Incredibles 2 (2018) WEB-DL 720p \u043e\u0442 \u0441\u0435\u043b\u0435\u0437\u0435\u043d\u044c | iTunes\r\nurl              : http://d.rutor.is/download.php?rss=661218\r\noriginal_url     : http://d.rutor.is/download.php?rss=661218\r\naccepted_by      : imdb\r\ncontent-length   : 82000\r\ncontent_files    : [Incredibles.2.2018.720p.WEB-DL.selezen.mkv]\r\ncontent_size     : 4012.526089668274\r\ndescription      : \u041c\u0443\u043b\u044c\u0442\u0438\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044f\r\nfilename         : [rutor.is]Incredibles.2.2018.720p.WEB-DL.selezen.mkv.torrent\r\nid               : incredibles 2 2018\r\nimdb_id          : tt3606756\r\nquality          : 720p webdl\r\nreason           : timeframe waiting\r\nrejected_by      : timeframe\r\n```\r\n\r\n1080p:\r\n```\r\ntitle            : Incredibles 2 (2018) WEB-DL 1080p \u043e\u0442 TeamHD | iTunes\r\nurl              : http://d.rutor.is/download.php?rss=661219\r\noriginal_url     : http://d.rutor.is/download.php?rss=661219\r\naccepted_by      : imdb\r\ncontent-length   : 90640\r\ncontent_files    : [Incredibles.2.2018.1080p.WEB-DL.TeamHD.mkv]\r\ncontent_size     : 4444.096870422363\r\ndescription      : \u041c\u0443\u043b\u044c\u0442\u0438\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044f\r\nfilename         : [rutor.is]Incredibles.2.2018.1080p.WEB-DL.TeamHD.mkv.torrent\r\nid               : incredibles 2 2018\r\nimdb_id          : tt3606756\r\nquality          : 1080p webdl\r\nraw_title        : \u0421\u0443\u043f\u0435\u0440\u0441\u0435\u043c\u0435\u0439\u043a\u0430 2 / Incredibles 2 (2018) WEB-DL 1080p \u043e\u0442 TeamHD | iTunes\r\nreason           : timeframe waiting\r\nrejected_by      : timeframe\r\n```\r\n\r\n</details>\r\n</details>\r\n\r\n### Additional information:\r\n\r\n- FlexGet version: 2.17.5 (first time noticed on 2.17.0, but probably is here for long time)\r\n- Python version: 3.5.3\r\n- Installation method: pip3 install (+docker)\r\n- Using daemon (yes/no): yes\r\n- OS and version: Debian Stretch\n", "before_files": [{"content": "from __future__ import unicode_literals, division, absolute_import\nfrom builtins import *  # noqa pylint: disable=unused-import, redefined-builtin\n\nimport logging\n\nfrom flexget import plugin\nfrom flexget.event import event\nfrom flexget.utils import qualities\n\nlog = logging.getLogger('metainfo_quality')\n\n\nclass MetainfoQuality(object):\n    \"\"\"\n    Utility:\n\n    Set quality attribute for entries.\n    \"\"\"\n\n    schema = {'type': 'boolean'}\n\n    @plugin.priority(127)  # Run after other plugins that might fill quality (series)\n    def on_task_metainfo(self, task, config):\n        # check if disabled (value set to false)\n        if config is False:\n            return\n        for entry in task.entries:\n            entry.register_lazy_func(self.get_quality, ['quality'])\n\n    def get_quality(self, entry):\n        if entry.get('quality', eval_lazy=False):\n            log.debug('Quality is already set to %s for %s, skipping quality detection.' %\n                      (entry['quality'], entry['title']))\n            return\n        entry['quality'] = qualities.Quality(entry['title'])\n        if entry['quality']:\n            log.trace('Found quality %s for %s' % (entry['quality'], entry['title']))\n\n\n@event('plugin.register')\ndef register_plugin():\n    plugin.register(MetainfoQuality, 'metainfo_quality', api_ver=2, builtin=True)\n", "path": "flexget/plugins/metainfo/quality.py"}], "after_files": [{"content": "from __future__ import unicode_literals, division, absolute_import\nfrom builtins import *  # noqa pylint: disable=unused-import, redefined-builtin\n\nimport logging\n\nfrom flexget import plugin\nfrom flexget.event import event\nfrom flexget.utils import qualities\n\nlog = logging.getLogger('metainfo_quality')\n\n\nclass MetainfoQuality(object):\n    \"\"\"\n    Utility:\n\n    Set quality attribute for entries.\n    \"\"\"\n\n    schema = {'type': 'boolean'}\n\n    @plugin.priority(127)  # Run after other plugins that might fill quality (series)\n    def on_task_metainfo(self, task, config):\n        # check if disabled (value set to false)\n        if config is False:\n            return\n        for entry in task.entries:\n            if isinstance(entry.get('quality', eval_lazy=False), str):\n                log.debug('Quality is already set to %s for %s, but has not been instantiated properly.' %\n                          (entry['quality'], entry['title']))\n                entry['quality'] = qualities.Quality(entry.get('quality', eval_lazy=False))\n            else:\n                entry.register_lazy_func(self.get_quality, ['quality'])\n\n    def get_quality(self, entry):\n        if entry.get('quality', eval_lazy=False):\n            log.debug('Quality is already set to %s for %s, skipping quality detection.' %\n                      (entry['quality'], entry['title']))\n            return\n        entry['quality'] = qualities.Quality(entry['title'])\n        if entry['quality']:\n            log.trace('Found quality %s for %s' % (entry['quality'], entry['title']))\n\n\n@event('plugin.register')\ndef register_plugin():\n    plugin.register(MetainfoQuality, 'metainfo_quality', api_ver=2, builtin=True)\n", "path": "flexget/plugins/metainfo/quality.py"}]}