0c91ba4a50e58734553bfb00fad5a3abab8abe43,homeassistant/components/media_player/gpmdp.py,GPMDP,update,#GPMDP#,179

Before Change


            receiving = True
            while receiving:
                from websocket import _exceptions
                try:
                    msg = json.loads(websocket.recv())
                    if msg["channel"] == "lyrics":
                        receiving = False  // end of now playing data
                    elif msg["channel"] == "playState":
                        if msg["payload"] is True:
                            self._status = STATE_PLAYING
                        else:
                            self._status = STATE_PAUSED
                    elif msg["channel"] == "track":
                        self._title = (msg["payload"]["title"])
                        self._artist = (msg["payload"]["artist"])
                        self._albumart = (msg["payload"]["albumArt"])
                except (_exceptions.WebSocketTimeoutException,
                        _exceptions.WebSocketProtocolException,
                        _exceptions.WebSocketPayloadException):
                    return

    @property
    def media_content_type(self):
        Content type of current playing media.
        return MEDIA_TYPE_MUSIC

After Change


            return
        self._seek_position = int(time_data["value"] / 1000)
        track_data = self.send_msg_with_req_id("getCurrentTrack")
        if track_data is None:
            return
        self._title = track_data["value"]["title"]
        self._artist = track_data["value"]["artist"]
        self._albumart = track_data["value"]["albumArt"]
        self._duration = int(track_data["value"]["duration"] / 1000)

    @property
    def media_content_type(self):
        Content type of current playing media.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: home-assistant/home-assistant
Commit Name: 0c91ba4a50e58734553bfb00fad5a3abab8abe43
Time: 2016-08-23
Author: nkgilley@gmail.com
File Name: homeassistant/components/media_player/gpmdp.py
Class Name: GPMDP
Method Name: update


Project Name: NervanaSystems/nlp-architect
Commit Name: 24d3656c6c4b3c6806954487720d53af775a1150
Time: 2018-06-07
Author: shira.guskin@intel.com
File Name: set_expansion_demo/ui/main.py
Class Name:
Method Name: get_expand_results_callback


Project Name: NervanaSystems/nlp-architect
Commit Name: 24d3656c6c4b3c6806954487720d53af775a1150
Time: 2018-06-07
Author: shira.guskin@intel.com
File Name: set_expansion_demo/ui/main.py
Class Name:
Method Name: get_phrases