'Update the metadata in the PlexPy database by matching rating keys.
Also updates all parents or children of the media item if it is a show/season/episode
or artist/album/track.
Required parameters:
old_rating_key (str):       12345
new_rating_key (str):       54321
media_type (str):           "movie", "show", "season", "episode", "artist", "album", "track"
Optional parameters:
None
Returns:
None'

@cherrypy.expose
@cherrypy.tools.json_out()
@requireAuth(member_of('admin'))
@addtoapi()
def update_metadata_details(self, old_rating_key, new_rating_key, media_type, **kwargs):

    if new_rating_key:
        data_factory = datafactory.DataFactory()
        pms_connect = pmsconnect.PmsConnect()
        old_key_list = data_factory.get_rating_keys_list(rating_key=old_rating_key, media_type=media_type)
        new_key_list = pms_connect.get_rating_keys_list(rating_key=new_rating_key, media_type=media_type)
        result = data_factory.update_metadata(old_key_list=old_key_list, new_key_list=new_key_list, media_type=media_type)
    if result:
        return {'message': result}
    else:
        return {'message': 'no    data    received'}
