From f23202e95655177103b330df2c71242a73148d44 Mon Sep 17 00:00:00 2001
From: CDrummond <craig.p.drummond@gmail.com>
Date: Sun, 9 Mar 2025 13:26:21 +0000
Subject: [PATCH] Document tags option

---
 UserGuide.md | 6 +++++-
 src/main.rs  | 4 ++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/UserGuide.md b/UserGuide.md
index ce8897a..25be2fe 100644
--- a/UserGuide.md
+++ b/UserGuide.md
@@ -122,6 +122,7 @@ music=/home/user/Music
 db=bliss.db
 lms=127.0.0.1
 ignore=ignore.txt
+tags=true
 ```
 
 The following items are supported:
@@ -137,7 +138,9 @@ password protected then use `user:pass@server` - e.g. `lms=pi:abc123@127.0.0.1`
 9000.
 * `ignore` specifies the name and location of a file containing items to ignore
 in mixes. See the `Ignore` section later on for more details.
-
+* `tags` specifies whether analysis results should be written to, and re-read from,
+files. Set to `true` or `false`. If enabled, then results are stored in a `COMMENT`
+tag that starts with `BLISS_ANALYSIS`
 
 
 Command-line parameters
@@ -160,6 +163,7 @@ tracks are to be analysed and how many old tracks are left in the database.
 * `-L` / `--lms` Hostname, or IP address, of your LMS server.
 * `-J` / `--json` JSONRPC port number of your LMS server.
 * `-n` / `--numtracks` Specify maximum number of tracks to analyse.
+* `-T` / `--tags` Write anlysis results to file tags, and read from file tags.
 
 Equivalent items specified in the INI config file (detailed above) will override
 any specified on the commandline.
diff --git a/src/main.rs b/src/main.rs
index e944506..9221ce7 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -142,6 +142,10 @@ fn main() {
                         Some(val) => { ignore_file = val; }
                         None => { }
                     }
+                    match config.get(TOP_LEVEL_INI_TAG, "tags") {
+                        Some(val) => { use_tags = val.eq("true"); }
+                        None => { }
+                    }
                 }
                 Err(e) => {
                     log::error!("Failed to load config file. {}", e);