Pipe connection fixes

This commit is contained in:
Phin 2022-05-11 05:46:02 +05:30
parent 8a29fb5aff
commit 307a1c759b
3 changed files with 5 additions and 5 deletions

View file

@ -45,7 +45,7 @@ The script must be running on the same machine as your Discord client.
"token": "HPbrz2NhfLRjU888Rrdt",
"servers": [
{
"name": "Bob's Home Media Server",
"name": "Bob's Home Media Server"
},
{
"name": "A Friend's Server",

View file

@ -30,10 +30,10 @@ class DiscordRpcService:
async def handshake(self):
try:
if isUnix:
self.pipeReader, self.pipeWriter = await asyncio.open_unix_connection(self.ipcPipe, loop = self.loop)
self.pipeReader, self.pipeWriter = await asyncio.open_unix_connection(self.ipcPipe)
else:
self.pipeReader = asyncio.StreamReader(loop = self.loop)
self.pipeWriter, _ = await self.loop.create_pipe_connection(lambda: asyncio.StreamReaderProtocol(self.pipeReader, loop = self.loop), self.ipcPipe)
self.pipeReader = asyncio.StreamReader()
self.pipeWriter, _ = await self.loop.create_pipe_connection(lambda: asyncio.StreamReaderProtocol(self.pipeReader), self.ipcPipe)
self.write(0, { "v": 1, "client_id": self.clientID })
if await self.read():
self.connected = True

View file

@ -2,7 +2,7 @@ import sys
import os
name = "Discord Rich Presence for Plex"
version = "2.0.0"
version = "2.0.1"
plexClientID = "discord-rich-presence-plex"
isUnix = sys.platform in ["linux", "darwin"]
processID = os.getpid()