petro-kushchak / homebridge-homepod-radio

MIT License
39 stars 2 forks source link

Enhancement: Stream multiple files #57

Open justjam2013 opened 1 month ago

justjam2013 commented 1 month ago

Allow streaming of multiple files, by specifying multiple semicolon/colon/space separated paths:

/path/to/file1.ext;/path/to/file2.ext

As the metadata passes streamerName instead of the individual details of the audio file (title, album, etc.), then stream.py:347 can be modified as follows:

        items = re.split(';: ', file_path)    # allow semicolon, colon, space separators
        paths = [item for item in items if item!= ””]    # filter out empty items
        for path in paths:
            await self.atv.stream_file(path, metadata)
            await asyncio.sleep(1)

This would allow streaming of multiple files, for example a whole album.

Quotation marks may be required around filePath in airplayDevice.ts:78 if spaces are allowed.

petro-kushchak commented 1 month ago

Hi, @justjam2013 - this absolutely makes sense, I should have some free time in a few weeks and will add this feature

justjam2013 commented 3 weeks ago

I verified with the pyatv author that the above code snippet should work for streaming multiple files, here.

justjam2013 commented 4 days ago

@petro-kushchak would you consider adding me as a contributor too this repo, so I can create PRs with code changes?

petro-kushchak commented 3 days ago

Hi - sure, sent you an invite