From 77e8436f3e2b09d85eaeb2d89d6ef1dd96eaf1bb Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Fri, 21 Aug 2015 19:57:39 +0200 Subject: [PATCH] docs: Elaborate on core/{cache,data}_dir usage Related to #1253 --- docs/config.rst | 12 ++++++++++++ mopidy/ext.py | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/docs/config.rst b/docs/config.rst index 26304176..7f0bda31 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -65,6 +65,13 @@ Core configuration Path to base directory for storing cached data. + Mopidy and extensions will use this path to cache data that can safely be + thrown away. + + If your system is running from an SD card, it can help avoid wear and + corruption of your SD card by pointing this config to another location. If + you have enough RAM, a tmpfs might be a good choice. + When running Mopidy as a regular user, this should usually be ``$XDG_CACHE_DIR/mopidy``, i.e. :file:`~/.cache/mopidy`. @@ -85,6 +92,11 @@ Core configuration Path to base directory for persistent data files. + Mopidy and extensions will use this path to store data that cannot be + be thrown away and reproduced without some effort. Examples include + Mopidy-Local's index of your media library and Mopidy-M3U's stored + playlists. + When running Mopidy as a regular user, this should usually be ``$XDG_DATA_DIR/mopidy``, i.e. :file:`~/.local/share/mopidy`. diff --git a/mopidy/ext.py b/mopidy/ext.py index 908b6d5d..199d7ab6 100644 --- a/mopidy/ext.py +++ b/mopidy/ext.py @@ -63,6 +63,8 @@ class Extension(object): def get_cache_dir(self, config): """Get or create cache directory for the extension. + Use this directory to cache data that can safely be thrown away. + :param config: the Mopidy config object :return: string """ @@ -87,6 +89,8 @@ class Extension(object): def get_data_dir(self, config): """Get or create data directory for the extension. + Use this directory to store data that should be persistent. + :param config: the Mopidy config object :returns: string """