Skip to content

Improve async logic on local IO #90

@geo-martino

Description

@geo-martino

Description

Currently, the program uses the mutagen package to handling loading audio files and their metadata/properties. However, this package appears to only be able to load files synchronously. As such, loading the metadata from audio files is currently not as optimised as it can be.

Ideally, the program should be able to utilise a package such as aiofiles to handle loading these files and their metadata. The handling of tag data is currently abstracted away to TagReader and TagWriter definitions which are in a hidden scope and the key load APIs exposed to the user are set up to run asynchronously despite the actual logic of these methods running synchronously still. As such, it should be possible to replace the mutagen package without introducing breaking changes to the code.

However, if it is possible to have mutagen load the files asynchronously, this would be preferred. Further research is needed.

Along with this, the loading of playlist files could also be made asynchronous with the aid of aiofiles or another similar package. Currently, while these load functions also operate in an asynchronous context, their logic is also synchronous.

It is a similar story too with LocalLibrary objects and their child classes. This should also be adapted as with playlists to fully complete this ticket.

Use case/motivation

Loading tracks from the system can be one of the slowest tasks to run at present, especially for an entire library. This would be a huge performance boost to one of the key areas of the program.

Related issues

Part of an ongoing drive to improve performance as per #13 and #86

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestlocalConcerns local module or functionality

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions