Skip to content

Instantly share code, notes, and snippets.

@simon-weber
simon-weber / example.py
Created June 15, 2017 22:06
disabling profiling around python-libfaketime example
# An example to disable profiling when faking time with python-libfaketime.
# Call this once from setup_package or a similar hook at the start of the test run.
# https://github.com/simon-weber/python-libfaketime
def disable_profiling_around_libfaketime(nose_config):
"""
libfaketime's interception of time system calls will break profilers.
If we detect that we're running under a profiler, we set up libfaketime callbacks to
temporarily disable profiling when we're faking the time.
@simon-weber
simon-weber / README.md
Created August 28, 2020 16:03
Import Google Music playcount and last played to MediaMonkey

This Python 3 script imports some Google Music metadata to MediaMonkey. Matches are found by a complete match of the song name, album, and artist.

To use it:

  • shut down MediaMonkey
  • make a copy of your MM.DB MediaMonkey database and put it in the same directory as this script
  • use the Autoplaylists for Google Music debug interface to generate a csv of your library, then place it in the same directory as this script and name it google_music_library.csv
  • run python import_gm.py and investigate the logs; repeat on a fresh copy of MM.DB each time until satisfied
  • back up your existing MM.DB and then overwrite it with the modified one