diff --git a/cdparacord/albumdata.py b/cdparacord/albumdata.py
index 37a9cde..ee1bb37 100644
--- a/cdparacord/albumdata.py
+++ b/cdparacord/albumdata.py
@@ -59,11 +59,23 @@ class Albumdata:
         self._ripdir = albumdata['ripdir']
         self._tracks = []
         counter = 0
+
         for trackdata in albumdata['tracks']:
             counter = counter + 1
             trackdata['tracknumber'] = counter
             self._tracks.append(Track(trackdata))
 
+        # Find out if there are multiple artists by seeing if at least
+        # one of the track artists differs from album artist
+        #
+        # This check used to be per-track only later in the rip process
+        # which caused issues.
+        if any(t.artist != self.albumartist for t in self._tracks):
+            self.multiartist = True
+        else:
+            self.multiartist = False
+
+
     @staticmethod
     def _print_albumdata(albumdata):
         """Print albumdata to fit a terminal.
@@ -306,8 +318,6 @@ class Albumdata:
 
     @classmethod
     def _generate_filename(cls, data, track, tracknumber, config):
-        # TODO: We need the filters here
-        # Also, the templates
         safetyfilter = config.get('safetyfilter')
         target_template = string.Template(config.get('target_template'))
         s = {
diff --git a/cdparacord/rip.py b/cdparacord/rip.py
index 2524a61..73f354f 100644
--- a/cdparacord/rip.py
+++ b/cdparacord/rip.py
@@ -66,9 +66,10 @@ class Rip:
             audiofile = mutagen.File(temp_encoded, easy=True)
             audiofile.add_tags()
 
-        if (track.artist != self._albumdata.albumartist
+        # We only tag albumartist on multi-artist albums, or if we're
+        # set to always tag albumartist.
+        if (self._albumdata.multiartist
                 or self._config.get('always_tag_albumartist')):
-            # We only tag albumartist Sometimes
             audiofile['albumartist'] = self._albumdata.albumartist
 
         # This is information we always save and presumably always have

Albumartist omitted on multi-artist album where artist matches albumartist
When rippng a CD that has tracks with artist tag matching albumartist tag, and the setting to always tag albumartist is set to false, the generation of albumartist tags is determined per track based on whether their values would be the same.

This logic works for single-artist-albums where no albumartist is wanted for whatever reason, but on multi-artist albums it means the tracks with artist == albumartist will not have albumartist tags created. While this is not a problem in all software, I personally use some pathological cases that actually treat the parts of the album with albumartist tagged, and the parts without, as two separate albums with the same name from the same albumartist. This needs to stop.
diff --git a/tests/test_albumdata.py b/tests/test_albumdata.py
index b544f26..2953ad0 100644
--- a/tests/test_albumdata.py
+++ b/tests/test_albumdata.py
@@ -249,6 +249,17 @@ def test_albumdata_tracks(albumdata):
     assert a.albumartist == 'Test Artist'
     assert a.title == 'Test album'
     assert a.date == '2018-01'
+    # This albumdata has a single artist
+    assert a.multiartist == False
+
+    # Also test that we can initialise a multiartist data
+    testdata2 = copy.deepcopy(testdata)
+    testdata2['tracks'][0]['artist'] = 'Test Artist 2'
+    a = albumdata.Albumdata(testdata2)
+    # We now have differing artist and albumartist but otherwise
+    # matching data
+    assert a.multiartist == True
+
 
 
 def test_initialise_albumdata(albumdata):
diff --git a/tests/test_rip.py b/tests/test_rip.py
index 3814f49..17b0cc5 100644
--- a/tests/test_rip.py
+++ b/tests/test_rip.py
@@ -258,6 +258,10 @@ def test_tag_track(monkeypatch, get_fake_config):
         def albumartist(self):
             return 'test'
 
+        @property
+        def multiartist(self):
+            return False
+
         @property
         def title(self):
             return 'test'
@@ -294,7 +298,7 @@ def test_tag_track(monkeypatch, get_fake_config):
         def __init__(*a, **b):
             import mutagen
             raise mutagen.MutagenError('something')
-    
+
     monkeypatch.setattr('mutagen.easyid3.EasyID3', FakeFile2)
     monkeypatch.setattr('mutagen.File', FakeFile)
 

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest coverage tox vulture pathlib2
apt-get update apt-get install -y gcc libdiscid0
3.7
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
cachetools==5.5.2
-e git+https://github.com/fennekki/cdparacord.git@ce0444604ac0d87ec586fd94b6c62096b10c3657#egg=cdparacord
certifi @ file:///croot/certifi_1671487769961/work/certifi
chardet==5.2.0
click==8.1.8
colorama==0.4.6
coverage==7.2.7
discid==1.2.0
distlib==0.3.9
exceptiongroup==1.2.2
filelock==3.12.2
importlib-metadata==6.7.0
iniconfig==2.0.0
musicbrainzngs==0.7.1
mutagen==1.47.0
packaging==24.0
pathlib2==2.3.7.post1
platformdirs==4.0.0
pluggy==1.2.0
pyproject-api==1.5.3
pytest==7.4.4
PyYAML==6.0.1
six==1.17.0
toml==0.10.2
tomli==2.0.1
tox==4.8.0
typing_extensions==4.7.1
virtualenv==20.26.6
vulture==2.9.1
zipp==3.15.0

name: cdparacord
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - cachetools==5.5.2
      - chardet==5.2.0
      - click==8.1.8
      - colorama==0.4.6
      - coverage==7.2.7
      - discid==1.2.0
      - distlib==0.3.9
      - exceptiongroup==1.2.2
      - filelock==3.12.2
      - importlib-metadata==6.7.0
      - iniconfig==2.0.0
      - musicbrainzngs==0.7.1
      - mutagen==1.47.0
      - packaging==24.0
      - pathlib2==2.3.7.post1
      - platformdirs==4.0.0
      - pluggy==1.2.0
      - pyproject-api==1.5.3
      - pytest==7.4.4
      - pyyaml==6.0.1
      - six==1.17.0
      - toml==0.10.2
      - tomli==2.0.1
      - tox==4.8.0
      - typing-extensions==4.7.1
      - virtualenv==20.26.6
      - vulture==2.9.1
      - zipp==3.15.0
prefix: /opt/conda/envs/cdparacord

tests/test_albumdata.py::test_albumdata_tracks
tests/test_albumdata.py::test_cdstub_result tests/test_albumdata.py::test_disc_result tests/test_albumdata.py::test_musicbrainzerror_result tests/test_albumdata.py::test_weird_nothing_result tests/test_albumdata.py::test_initialise_track tests/test_albumdata.py::test_initialise_albumdata tests/test_albumdata.py::test_print_albumdata_80 tests/test_albumdata.py::test_print_albumdata_60 tests/test_albumdata.py::test_get_track_count tests/test_albumdata.py::test_get_no_track_count tests/test_albumdata.py::test_select_albumdata tests/test_albumdata.py::test_select_albumdata_multicd tests/test_albumdata.py::test_previous_result tests/test_albumdata.py::test_invalid_previous_result tests/test_albumdata.py::test_no_previous_result tests/test_albumdata.py::test_from_user_input tests/test_albumdata.py::test_edit_albumdata tests/test_albumdata.py::test_generate_filename tests/test_albumdata.py::test_disc_result_no_date tests/test_rip.py::test_construct_rip tests/test_rip.py::test_rip_pipeline tests/test_rip.py::test_rip_track tests/test_rip.py::test_encode_track tests/test_rip.py::test_tag_track
cdparacord/rip.py cdparacord/albumdata.py
cdparacord/rip.py cdparacord/albumdata.py