pymcws will only transmit changed and new fields. Once you are happy, call _info() and pass it the file to save the changes. Files keep track of which values you have modified. Changing values works the same way as well, but changes are not persisted immediately. Calling my_file returns the datetime of the corresponding field. When saving changes to files, the types are converted back to jriver-compatible versions.įiles themselves are simply (extended) dictionaries. To work with common types like string, int, float, datetime etc. Pymcws queries these field definitions and automatically performs type conversions for them, allowing users JRiver Media Center has a complex model for files and allows adding custom fields with varying types. Inside your home network, this will be the local IP, When providing an access key, the server is resolved,Īnd the best connection strategy is chosen. The most important feature is connection negotiation. The MediaServer class covers all functionality to communicate with JRiver Media Center. Stored in pymcws.recipes and contain functionality like playing and querying albums. More on these classes in the following sections.įinally, pymcws provides convenience methods that enable users to quickly execute common tasks. The main difference is that pymcws provides classes that model complex entities like zones and files, and uses theseĬlasses to facilitate interaction. The behaviour if the API has been replicated 1:1, where exceptions exist, they are documented. ![]() The general philosophy of pymcws is to make communication with mcws as easy as possible. If you intend to use the second option exclusively, consider using pymcws.get_media_server_light() to get your server - the returned class does not import API functions directly. These two calls are functionally identical: # get the server office. The server returned in this way already imports the API functions and provides them locally. The easiest way to get one is to call pymcws.get_media_server() along with an access key, username and password. To call these functions, you need a server. This way, you can import API functions to your scripts as needed. If you are looking for then that's located under. Pymcws wraps the MCWS API in a 1:1 manner. playpause ( zones )įor a full set of examples, please see examples.py. zones () for zone in zones : print ( zone. query_album ( "Ludovico Einaudi", "I Giorni" ) office. get_media_server ( "AccessKey", "readonly", "supersecretpassword" ) # use a recipe to play an album files = office. You can then initialize a server and start using commands: # get the server office = mcws. Using this method, all functions and recipes are imported and available via the ![]() It as a one-stop-shop-all: import pymcws as mcws Use your package manager of choice to install pymcws: pip install pymcwsįirst order of action is to import pymcws. Backwards compatibility is possible,īut will have to be requested - it is mainly the automatic field conversion that is preventing it. Additionally, common use-cases can be implemented inĬurrently, the minimum required version of JRiver MC is 26. The aim is to replicate the MCWS functionality as close as possible in a pythonian,Įasy to use manner. A python API wrapper for MCWS, the web interface of the excellent JRiver Media Center.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |