Showing a short statistic after Picard finishes

CMD as regular or Admin?

A=1 or A = 1

Which correct?

Event Viewer

Current code

PLUGIN_NAME = 'Stat'
PLUGIN_AUTHOR = 'ichneumon, hrglgrmpf'
PLUGIN_DESCRIPTION = '''Remove all perfectly matched albums from the selection.'''
PLUGIN_VERSION = '0.3'
PLUGIN_API_VERSIONS = ['2.0', '2.1', '2.2', '2.3']
PLUGIN_LICENSE = "GPL-2.0"
PLUGIN_LICENSE_URL = "https://www.gnu.org/licenses/gpl-2.0.html"

from PyQt5.QtCore import QCoreApplication

from picard.album import Album
from picard.ui.itemviews import BaseAction, register_album_action
from picard.ui.mainwindow import register_ui_init

def ui_init(mainwindow):
    # Get the main application instance, an instance of picard.Tagger.
    tagger = QCoreApplication.instance()
    # Register a function to run on exit
    tagger.register_cleanup(on_exit)

def on_exit():
    tagger = QCoreApplication.instance()
    albums = tagger.albums
    # Iterate over the albums, check album state with album.is_complete()
    # and album.is_modified()
    # Then show a QDialog with the results (your code above was on the right track)

class RemovePerfectAlbums(BaseAction):
    NAME = 'Stat'
    A = 1
    def callback(self, objs):
        for album in objs:
            if (isinstance(album, Album) and album.loaded
               and album.is_complete() and album.get_num_unsaved_files() == 0):
                self.tagger.remove_album(album)
                A=A+1
            QCoreApplication.processEvents()
            print(A)

register_album_action(RemovePerfectAlbums())
register_ui_init(ui_init)

Current code and still Application Error 1000

PLUGIN_NAME = "Statistic"
PLUGIN_AUTHOR = "outsidecontext, Echelon666"
PLUGIN_DESCRIPTION = "Counts the album types in the right panel of Picard after it finishes its work"
PLUGIN_VERSION = '0.1'
PLUGIN_API_VERSIONS = ['2.0', '2.1', '2.2', '2.3']
PLUGIN_LICENSE = "GPL-2.0"
PLUGIN_LICENSE_URL = "https://www.gnu.org/licenses/gpl-2.0.html"

from PyQt5.QtCore import QCoreApplication

from picard.album import Album
from picard.ui.itemviews import BaseAction, register_album_action
from picard.ui.mainwindow import register_ui_init

def ui_init(mainwindow):
    # Get the main application instance, an instance of picard.Tagger.
    tagger = QCoreApplication.instance()
    # Register a function to run on exit
    tagger.register_cleanup(on_exit)

def on_exit():
    tagger = QCoreApplication.instance()
    albums = tagger.albums
    # Iterate over the albums, check album state with album.is_complete()
    # and album.is_modified()
    # Then show a QDialog with the results (your code above was on the right track)

class RemovePerfectAlbums(BaseAction):
    NAME = 'Statistic'
    A = 1
    def callback(self, objs):
        for album in objs:
            if (isinstance(album, Album) and album.loaded
                and album.is_complete() and album.get_num_unsaved_files() == 0):
                    self.tagger.remove_album(album)
            QCoreApplication.processEvents()
        print(A)

register_album_action(RemovePerfectAlbums())
register_ui_init(ui_init)

Errors from Event Viewer

1000

Faulting application name: picard.exe, version: 2.12.3.0, time stamp: 0x66d811fe
Faulting module name: Qt5Core.dll, version: 5.15.2.0, time stamp: 0x5fa4dd3b
Exception code: 0xc0000409
Fault offset: 0x00000000000204e8
Faulting process id: 0x0x55D8
Faulting application start time: 0x0x1DB020F71A496CA
Faulting application path: C:\Program Files\MusicBrainz Picard\picard.exe
Faulting module path: C:\Program Files\MusicBrainz Picard\Qt5Core.dll
Report Id: 5acca747-d29b-41a4-bb10-fa4df4dc78b0
Faulting package full name:
Faulting package-relative application ID:

1001

Fault bucket 1171071595997226066, type 5
Event Name: BEX64
Response: Niedostępny
Cab Id: 0

Problem signature:
P1: picard.exe
P2: 2.12.3.0
P3: 66d811fe
P4: Qt5Core.dll
P5: 5.15.2.0
P6: 5fa4dd3b
P7: 00000000000204e8
P8: c0000409
P9: 0000000000000007
P10:

Attached files:
\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER.c7bdcb6b-4bf2-4129-bfda-e4dc6b579f99.tmp.mdmp
\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER.dbaef3ab-b642-4aa8-b54b-f28c5465c847.tmp.WERInternalMetadata.xml
\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER.ec52f2a0-dd0c-4ae7-8e9b-4d27e8b24e24.tmp.csv
\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER.a6db1dda-6f12-4aab-b438-2b859f4e6beb.tmp.txt
\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER.35765a80-d49a-460e-b08b-71db54037c23.tmp.xml

These files may be available here:
\?\C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_picard.exe_1956993dc215d1a13751d6905f85162c2b7c8dd_8626e484_dc9d3d50-9d93-4946-8541-775969f70651

Analysis symbol:
Rechecking for solution: 0
Report Id: 5acca747-d29b-41a4-bb10-fa4df4dc78b0
Report Status: 268435456
Hashed bucket: 606fe4cc1b815473c0407b6975f6e452
Cab Guid: 0

Unfortunately, one more correction.

But it should still display ‘1’

PLUGIN_NAME = "Statistic"
PLUGIN_AUTHOR = "outsidecontext, Echelon666"
PLUGIN_DESCRIPTION = "Counts the album types in the right panel of Picard after it finishes its work"
PLUGIN_VERSION = '0.1'
PLUGIN_API_VERSIONS = ['2.0', '2.1', '2.2', '2.3']
PLUGIN_LICENSE = "GPL-2.0"
PLUGIN_LICENSE_URL = "https://www.gnu.org/licenses/gpl-2.0.html"

from PyQt5.QtCore import QCoreApplication

from picard.album import Album
from picard.ui.itemviews import BaseAction, register_album_action
from picard.ui.mainwindow import register_ui_init

def ui_init(mainwindow):
    # Get the main application instance, an instance of picard.Tagger.
    tagger = QCoreApplication.instance()
    # Register a function to run on exit
    tagger.register_cleanup(on_exit)

def on_exit():
    tagger = QCoreApplication.instance()
    albums = tagger.albums
    # Iterate over the albums, check album state with album.is_complete()
    # and album.is_modified()
    # Then show a QDialog with the results (your code above was on the right track)

class RemovePerfectAlbums(BaseAction):
    NAME = 'Statistic'
    A = 1
    def callback(self, objs):
        for album in objs:
            if (isinstance(album, Album) and album.loaded
                and album.is_complete() and album.get_num_unsaved_files() == 0):
                    self.tagger.remove_album(album)
            QCoreApplication.processEvents()
            A=A+1
        print(A)

register_album_action(RemovePerfectAlbums())
register_ui_init(ui_init)

@outsidecontext

Maybe we didn’t understand each other.

I will write exactly what it means that Picard is finishing.

It’s not that Picard turns off and then “farewell” displays our plug-in window.

I will write in order:

  1. Add a directory to Picard
  2. Wait for it to update all the disk icons on the right side of Picard. (this is the end)

And only now:
3. Select all albums in the right panel
4. Now right-click and select Plugins==>Statistic
5. The statistics window appears.

@IvanDobsky

This is the original plugin and it works.

PLUGIN_NAME = 'Remove Perfect Albums'
PLUGIN_AUTHOR = 'ichneumon, hrglgrmpf'
PLUGIN_DESCRIPTION = '''Remove all perfectly matched albums from the selection.'''
PLUGIN_VERSION = '0.3'
PLUGIN_API_VERSIONS = ['2.0', '2.1', '2.2', '2.3']
PLUGIN_LICENSE = "GPL-2.0"
PLUGIN_LICENSE_URL = "https://www.gnu.org/licenses/gpl-2.0.html"

from PyQt5.QtCore import QCoreApplication

from picard.album import Album
from picard.ui.itemviews import BaseAction, register_album_action


class RemovePerfectAlbums(BaseAction):
    NAME = 'Remove perfect albums'

    def callback(self, objs):
        for album in objs:
            if (isinstance(album, Album) and album.loaded
               and album.is_complete() and album.get_num_unsaved_files() == 0):
                self.tagger.remove_album(album)
            QCoreApplication.processEvents()


register_album_action(RemovePerfectAlbums())

@outsidecontext

I managed to display the Statistic graphics window without your lines of code.

I stopped it with time.sleep(100)

After this, Picard turns itself off.

But I would also like print text in a regular window.

plugin kalk

PLUGIN_NAME = "kalk"
PLUGIN_AUTHOR = "Piotr Sakowski aka Echelon666"
PLUGIN_DESCRIPTION = "Counts albums changed and unchanged"
PLUGIN_VERSION = '0.1'
PLUGIN_API_VERSIONS = ['2.2']
PLUGIN_LICENSE = "GPL-2.0-or-later"
PLUGIN_LICENSE_URL = "https://www.gnu.org/licenses/gpl-2.0.html"

from PyQt5.QtCore import QCoreApplication
from PyQt5.QtWidgets import QApplication, QWidget

from picard.album import Album
from picard.ui.itemviews import BaseAction, register_album_action

class Kalkulator(QWidget):
    def __init__(self, parent=None):
        super().__init__(parent)

        self.interfejs()

    def interfejs(self):

        self.resize(300, 100)
        self.setWindowTitle("Statistic")
        self.show()

class RemovePerfectAlbums(BaseAction):
    NAME = 'kalk'

    def callback(self, objs):
        for album in objs:
            if (isinstance(album, Album) and album.loaded
               and album.is_complete() and album.get_num_unsaved_files() == 0):
           #      A=A+1
                self.tagger.remove_album(album)
            QCoreApplication.processEvents()
        okno = Kalkulator()
        okno.start()
        time.sleep(100)
    
#input("Press Enter to continue...")

#print("Perfect albums ==> {A}")

register_album_action(RemovePerfectAlbums())

@outsidecontext

Why doesn’t this code display this:

kalkulator02

class StatWindow(QWidget):

    def __init__(self, parent=None):
        super().__init__(parent)

        self.interfejs()

    def interfejs(self):

        # etykiety
        etykieta1 = QLabel("Liczba 1:", self)
        etykieta2 = QLabel("Liczba 2:", self)
        etykieta3 = QLabel("Wynik:", self)

        # przypisanie widgetów do układu tabelarycznego
        ukladT = QGridLayout()
        ukladT.addWidget(etykieta1, 0, 0)
        ukladT.addWidget(etykieta2, 0, 1)
        ukladT.addWidget(etykieta3, 0, 2)

        # przypisanie utworzonego układu do okna
        self.setLayout(ukladT)

        self.setGeometry(100, 100, 300, 100)
    #    self.setWindowIcon(QIcon('kalkulator.png'))
        self.setWindowTitle("Statistic")
        self.show()

Now there is only:

kalkulator01

I made progress. :wink:

Current code:

PLUGIN_NAME = "kalk2"
PLUGIN_AUTHOR = "outsidecontext, Echelon666"
PLUGIN_DESCRIPTION = "Album type counter in the right Picard panel"
PLUGIN_VERSION = '0.1'
PLUGIN_API_VERSIONS = ['2.0', '2.1', '2.2', '2.3']
PLUGIN_LICENSE = "GPL-2.0"
PLUGIN_LICENSE_URL = "https://www.gnu.org/licenses/gpl-2.0.html"

from PyQt5.QtCore import QCoreApplication
from PyQt5.QtWidgets import QApplication, QWidget
#from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QLabel, QGridLayout

from picard.album import Album
from picard.ui.itemviews import BaseAction, register_album_action

class StatWindow(QWidget):

    def __init__(self, parent=None):
        super().__init__(parent)

        self.interfejs()

    def interfejs(self):

        # etykiety
        etykieta1 = QLabel("Perfect albums:", self)
        etykieta2 = QLabel("Modified albums:", self)
        etykieta3 = QLabel("Error albums:", self)

        # przypisanie widgetów do układu tabelarycznego
        ukladT = QGridLayout()
        ukladT.addWidget(etykieta1, 0, 0)
        ukladT.addWidget(etykieta2, 1, 0)
        ukladT.addWidget(etykieta3, 2, 0)

        # przypisanie utworzonego układu do okna
        self.setLayout(ukladT)

        self.setGeometry(1200, 200, 300, 100)
    #    self.setWindowIcon(QIcon('kalkulator.png'))
        self.setWindowTitle("Statistic")
        self.show()


class Album:
    pass

class RemovePerfectAlbums(BaseAction):
    NAME = 'kalk2'
    A = 0
    def callback(self, objs):
        for album in objs:
            if (isinstance(album, Album) and album.loaded
               and album.is_complete() and album.get_num_unsaved_files() == 0):
                self.tagger.remove_album(album)
            QCoreApplication.processEvents()
            A=A+1
        
window = StatWindow()
window.start()
album = Album()
album = A
print(album)
time.sleep(500)        
    
#input("Press Enter to continue...")

#print("Perfect albums ==> {A}")

register_album_action(RemovePerfectAlbums())

When trying to install the plugin, it shows an error, er.png

But it displays the plugin window.

After pressing OK it looks like this, er2.png

If I press Add directory, the Statistic window disappears.

I cleaned up the code a bit.

I have a problem with the integer A variable.

The program probably does not enter the AlbumCounter procedure.

How do I pass the value A from the AlbumCounter procedure to the StatWindow procedure?

I placed my comments next to this variable in the code.

PLUGIN_NAME = "stat2"
PLUGIN_AUTHOR = "outsidecontext, Echelon666"
PLUGIN_DESCRIPTION = "Album type counter in the right Picard panel"
PLUGIN_VERSION = '0.1'
PLUGIN_API_VERSIONS = ['2.0', '2.1', '2.2', '2.3']
PLUGIN_LICENSE = "GPL-2.0"
PLUGIN_LICENSE_URL = "https://www.gnu.org/licenses/gpl-2.0.html"

from PyQt5.QtCore import QCoreApplication
from PyQt5.QtWidgets import QApplication, QWidget
#from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QLabel, QGridLayout

from picard.album import Album
from picard.ui.itemviews import BaseAction, register_album_action

A = 0   # Reset to zero at the beginning

class StatWindow(QWidget):

    def __init__(self, parent=None):
        super().__init__(parent)

        self.interfejs()

    def interfejs(self):

        etykieta1 = QLabel("Perfect albums:", self)
        etykieta2 = QLabel("Modified albums:", self)
        etykieta3 = QLabel("Error albums:", self)
        
        etykieta1a = QLabel(str(A), self)
        etykieta2b = QLabel("0", self)
        etykieta3c = QLabel("0", self)

        ukladT = QGridLayout()
        ukladT.addWidget(etykieta1, 0, 0)
        ukladT.addWidget(etykieta2, 1, 0)
        ukladT.addWidget(etykieta3, 2, 0)
        
        ukladT.addWidget(etykieta1a, 0, 1)
        ukladT.addWidget(etykieta2b, 1, 1)
        ukladT.addWidget(etykieta3c, 2, 1)

        self.setLayout(ukladT)

        self.setGeometry(1200, 200, 300, 100)
    #    self.setWindowIcon(QIcon('kalkulator.png'))
        self.setWindowTitle("Statistic")
        self.show()


class AlbumsCounter(BaseAction):
    NAME = 'stat2'
    A=2  # Assignment 2 for test purposes
    def callback(self, objs):
        for album in objs:
            if (isinstance(album, Album) and album.loaded
               and album.is_complete() and album.get_num_unsaved_files() == 0):
                self.tagger.remove_album(album)
            QCoreApplication.processEvents()
            A=A+1  # Here it should count the number of Perfect albums

counter = AlbumsCounter()        
window = StatWindow()
window.start()

register_album_action(RemovePerfectAlbums())

Further progress.

Enters the AlbumsCounter class.
Variable A changes the value to 2.
However, it does not enter the for loop.

Current code:

PLUGIN_NAME = "stat2"
PLUGIN_AUTHOR = "outsidecontext, Echelon666"
PLUGIN_DESCRIPTION = "Album type counter in the right Picard panel"
PLUGIN_VERSION = '0.1'
PLUGIN_API_VERSIONS = ['2.0', '2.1', '2.2', '2.3']
PLUGIN_LICENSE = "GPL-2.0"
PLUGIN_LICENSE_URL = "https://www.gnu.org/licenses/gpl-2.0.html"

from PyQt5.QtCore import QCoreApplication
from PyQt5.QtWidgets import QApplication, QWidget
#from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QLabel, QGridLayout

from picard.album import Album
from picard.ui.itemviews import BaseAction, register_album_action

A = 0   # Reset to zero at the beginning

class AlbumsCounter(BaseAction):
    NAME = 'stat2'
    
    def __init__(self):
        super().__init__()
        
    A=2  # Assignment 2 for test purposes
    def callback(self, objs):
        for album in objs:
            if (isinstance(album, Album) and album.loaded
               and album.is_complete() and album.get_num_unsaved_files() == 0):
                self.tagger.remove_album(album)
                A=A+1  # Here it should count the number of Perfect albums
            QCoreApplication.processEvents()
            

class StatWindow(QWidget):

    def __init__(self):
        super().__init__()

        self.interfejs()

    def interfejs(self):

        etykieta1 = QLabel("Perfect albums:", self)
        etykieta2 = QLabel("Modified albums:", self)
        etykieta3 = QLabel("Error albums:", self)
        
        etykieta1a = QLabel(str(counter.A), self)
        etykieta2b = QLabel("0", self)
        etykieta3c = QLabel("0", self)

        ukladT = QGridLayout()
        ukladT.addWidget(etykieta1, 0, 0)
        ukladT.addWidget(etykieta2, 1, 0)
        ukladT.addWidget(etykieta3, 2, 0)
        
        ukladT.addWidget(etykieta1a, 0, 1)
        ukladT.addWidget(etykieta2b, 1, 1)
        ukladT.addWidget(etykieta3c, 2, 1)

        self.setLayout(ukladT)

        self.setGeometry(1200, 200, 300, 100)
    #    self.setWindowIcon(QIcon('kalkulator.png'))
        self.setWindowTitle("Statistic")
        self.show()

counter = AlbumsCounter()
window = StatWindow()
#window.start()

register_album_action(RemovePerfectAlbums())

Edit:

It does not enter the for loop because the music directory is not added.

Can anyone help me on this:

Don’t let the plugin run immediately upon installation.

It’s probably about the order or indentation of the instructions.

I used the Log window.

log

It’s better.

There is no warning, the plugin is installed but it turn off Picard.

Current code:

PLUGIN_NAME = "stat2"
PLUGIN_AUTHOR = "outsidecontext, Echelon666"
PLUGIN_DESCRIPTION = "Album type counter in the right Picard panel"
PLUGIN_VERSION = '0.1'
PLUGIN_API_VERSIONS = ['2.0', '2.1', '2.2', '2.3']
PLUGIN_LICENSE = "GPL-2.0"
PLUGIN_LICENSE_URL = "https://www.gnu.org/licenses/gpl-2.0.html"

from PyQt5.QtCore import QCoreApplication
from PyQt5.QtWidgets import QApplication, QWidget
#from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QLabel, QGridLayout

from picard.album import Album
from picard.ui.itemviews import BaseAction, register_album_action

A = 0   # Reset to zero at the beginning

class AlbumCounter(BaseAction):
    NAME = 'stat2'
    
    def __init__(self):
        super().__init__()
        
    A=2  # Assignment 2 for test purposes
    def callback(self, objs):
        for album in objs:
            if (isinstance(album, Album) and album.loaded
               and album.is_complete() and album.get_num_unsaved_files() == 0):
                self.tagger.remove_album(album)
                A=A+1  # Here it should count the number of Perfect albums
            QCoreApplication.processEvents()
            

class StatWindow(QWidget):

    def __init__(self):
        super().__init__()

        self.interfejs()

    def interfejs(self):

        etykieta1 = QLabel("Perfect albums:", self)
        etykieta2 = QLabel("Modified albums:", self)
        etykieta3 = QLabel("Error albums:", self)
        
        etykieta1a = QLabel(str(counter.A), self)
        etykieta2b = QLabel("0", self)
        etykieta3c = QLabel("0", self)

        ukladT = QGridLayout()
        ukladT.addWidget(etykieta1, 0, 0)
        ukladT.addWidget(etykieta2, 1, 0)
        ukladT.addWidget(etykieta3, 2, 0)
        
        ukladT.addWidget(etykieta1a, 0, 1)
        ukladT.addWidget(etykieta2b, 1, 1)
        ukladT.addWidget(etykieta3c, 2, 1)

        self.setLayout(ukladT)

        self.setGeometry(1200, 200, 300, 100)
    #    self.setWindowIcon(QIcon('kalkulator.png'))
        self.setWindowTitle("Statistic")
        self.show()

counter = AlbumCounter()
window = StatWindow()
window.start()

register_album_action(AlbumCounter())

@outsidecontext

Could you please check this debug.log?

D: 22:00:00,682 tagger.__init__:315: Starting Picard from 'C:\\Program Files\\MusicBrainz Picard\\picard\\tagger.pyc'
D: 22:00:00,682 tagger.__init__:316: Platform: Windows-10-10.0.22631-SP0 CPython 3.8.10
D: 22:00:00,682 tagger.__init__:318: Versions: Picard 2.12.3, Python 3.8.10, PyQt 5.15.10, Qt 5.15.2, Mutagen 1.47.0, Discid discid 1.2.0, libdiscid 0.6.4, astrcmp C, SSL OpenSSL 1.1.1b  26 Feb 2019
D: 22:00:00,682 tagger.__init__:319: Configuration file path: 'C:/Users/Piotr/AppData/Roaming/MusicBrainz/Picard.ini'
D: 22:00:00,682 tagger.__init__:321: User directory: 'C:\\Users\\Piotr\\AppData\\Local\\MusicBrainz\\Picard'
D: 22:00:00,682 tagger.__init__:322: System long path support: True
D: 22:00:00,682 tagger.__init__:325: Qt Env.: QT_PLUGIN_PATH='C:\\Program Files\\MusicBrainz Picard\\PyQt5\\Qt5\\plugins'
D: 22:00:00,682 i18n.setup_gettext:150: UI language: 'en'
D: 22:00:00,682 i18n.setup_gettext:161: Trying locales: ['en_US.cp1250', 'en_US.UTF-8', 'en', 'pl_PL']
D: 22:00:00,693 i18n.setup_gettext:170: Failed to set locale: 'en_US.cp1250'
D: 22:00:00,693 i18n.setup_gettext:167: Set locale to: 'en_US.UTF-8'
D: 22:00:00,693 i18n.setup_gettext:178: Using locale: 'en'
D: 22:00:00,703 i18n._load_translation:125: Loading gettext translation for picard, localedir='C:\\Program Files\\MusicBrainz Picard\\locale', language='en'
D: 22:00:00,703 i18n._load_translation:128: [Errno 2] No translation file found for domain: 'picard'
D: 22:00:00,703 i18n._load_translation:125: Loading gettext translation for picard-attributes, localedir='C:\\Program Files\\MusicBrainz Picard\\locale', language='en'
D: 22:00:00,704 i18n._load_translation:128: [Errno 2] No translation file found for domain: 'picard-attributes'
D: 22:00:00,704 i18n._load_translation:125: Loading gettext translation for picard-constants, localedir='C:\\Program Files\\MusicBrainz Picard\\locale', language='en'
D: 22:00:00,704 i18n._load_translation:128: [Errno 2] No translation file found for domain: 'picard-constants'
D: 22:00:00,704 i18n._load_translation:125: Loading gettext translation for picard-countries, localedir='C:\\Program Files\\MusicBrainz Picard\\locale', language='en'
D: 22:00:00,704 i18n._load_translation:128: [Errno 2] No translation file found for domain: 'picard-countries'
D: 22:00:00,704 i18n.setup_gettext:201: _ = <bound method NullTranslations.gettext of <gettext.NullTranslations object at 0x000001E7416E8940>>
D: 22:00:00,704 i18n.setup_gettext:202: N_ = <function <lambda> at 0x000001E73FE19EE0>
D: 22:00:00,704 i18n.setup_gettext:203: ngettext = <bound method NullTranslations.ngettext of <gettext.NullTranslations object at 0x000001E7416E8940>>
D: 22:00:00,704 i18n.setup_gettext:204: gettext_countries = <bound method NullTranslations.gettext of <gettext.NullTranslations object at 0x000001E7421D78B0>>
D: 22:00:00,704 i18n.setup_gettext:205: gettext_attributes = <bound method NullTranslations.gettext of <gettext.NullTranslations object at 0x000001E7421D77F0>>
D: 22:00:00,704 i18n.setup_gettext:206: pgettext_attributes = <bound method NullTranslations.pgettext of <gettext.NullTranslations object at 0x000001E7421D77F0>>
D: 22:00:00,716 webservice._network_accessible_changed:388: Network accessible requested: 1, actual: 1
D: 22:00:00,731 webservice.set_cache:410: NetworkDiskCache dir: 'C:/Users/Piotr/AppData/Local/MusicBrainz/Picard/cache/network/' current size: 90.0 MB max size: 100 MB
D: 22:00:00,732 pluginmanager.load_plugins_from_directory:264: Looking for plugins in directory 'C:\\Users\\Piotr\\AppData\\Local\\MusicBrainz\\Picard\\plugins', 4 names found
D: 22:00:00,733 plugin.register:82: ExtensionPoint: track_metadata_processors register <- plugin='non_ascii_equivalents' item=<function main at 0x000001E74171D940>
D: 22:00:00,733 plugin.register:82: ExtensionPoint: album_metadata_processors register <- plugin='non_ascii_equivalents' item=<function main at 0x000001E74171D940>
D: 22:00:00,733 pluginmanager._load_plugin:337: Loading plugin 'Non-ASCII Equivalents Polish' version 0.4.0.final0, compatible with API: 2.0
D: 22:00:00,734 plugin.register:82: ExtensionPoint: album_actions register <- plugin='remove_perfect_albums' item=<picard.plugins.remove_perfect_albums.RemovePerfectAlbums object at 0x000001E74171DAF0>
D: 22:00:00,734 pluginmanager._load_plugin:337: Loading plugin 'Remove Perfect Albums' version 0.3.0.final0, compatible with API: 2.0, 2.1, 2.2, 2.3
D: 22:00:00,971 plugin.register:82: ExtensionPoint: album_actions register <- plugin='stat2' item=<picard.plugins.stat2.AlbumCounter object at 0x000001E7422054C0>
D: 22:00:00,971 pluginmanager._load_plugin:337: Loading plugin 'stat2' version 0.1.0.final0, compatible with API: 2.0, 2.1, 2.2, 2.3
D: 22:00:00,972 plugin.register:82: ExtensionPoint: album_actions register <- plugin='statistic' item=<picard.plugins.statistic.RemovePerfectAlbums object at 0x000001E742205790>
D: 22:00:00,972 plugin.register:82: ExtensionPoint: ui_init register <- plugin='statistic' item=<function ui_init at 0x000001E742205550>
D: 22:00:00,972 pluginmanager._load_plugin:337: Loading plugin 'Statistic' version 0.1.0.final0, compatible with API: 2.0, 2.1, 2.2, 2.3
I: 22:00:00,972 pluginmanager.load_plugins_from_directory:252: Plugin directory 'C:\\Program Files\\MusicBrainz Picard\\plugins' doesn't exist
D: 22:00:00,976 ui/playertoolbar.__init__:91: Internal player: QtMultimedia available, initializing QMediaPlayer
D: 22:00:00,995 ui/playertoolbar.__init__:98: Internal player: available, QMediaPlayer set up
D: 22:00:01,060 tagger.main:1576: Looking for Qt locale en_US in C:/Program Files/MusicBrainz Picard/PyQt5/Qt5/translations
I: 22:00:01,065 browser/browser.start:121: Starting the browser integration (127.0.0.1:8000)
D: 22:00:01,101 config.event:261: Config file update requested on thread 14876
D: 22:00:02,793 ui/mainwindow.auto_update_check:1786: Skipping startup check for program updates.  Today: 2024-09-09, Last check: 2024-09-03 (Check interval: 7 days), Update level: 0 (stable)
D: 22:00:02,793 config.event:261: Config file update requested on thread 14876

Additional investigation.

When I click run the plugin on the “silver” CD, nothing happens.

However, when the “gold” setting turns off Picard.

Debug.log is from “gold” disc.

I finally removed the premature startup.

But debug.log is the same.

@outsidecontext

This line A=A+1 in

if (isinstance(album, Album) and album.loaded and album.is_complete() and album.get_num_unsaved_files() == 0):
                self.tagger.remove_album(album)
        #        A=A+1  # Here it should count the number of Perfect albums
            QCoreApplication.processEvents()

causes a failure.

debug.log without line A=A+1

D: 10:13:54,455 config.event:261: Config file update requested on thread 4504
D: 10:13:56,522 webservice/ratecontrol.get_delay_to_next_request:127: ('musicbrainz.org', 443): Last request was 385392 ms ago, starting another one
D: 10:13:56,522 webservice/ratecontrol.increment_requests:147: ('musicbrainz.org', 443): Incrementing requests to: 1
D: 10:13:56,715 webservice/ratecontrol.decrement_requests:155: ('musicbrainz.org', 443): Decrementing requests to: 0
D: 10:13:56,716 webservice._handle_reply:559: Received reply for https://musicbrainz.org/ws/2/release?release-group=1f4d4fe7-ddb0-36b8-8fd9-283d40190c3b&limit=100&inc=labels%2Bmedia -> HTTP 200 (OK) 
D: 10:13:56,716 webservice._handle_reply:572: Response received: {'release-offset': 0, 'release-count': 5, 'releases': [{'packaging': 'Cardboard/Paper Sleeve', 'release-events': [{'area': {'disambiguation': '', 'type': None, 'sort-name': 'United Kingdom', 'iso-3166-1-codes': ['GB'], 'type-id': None, 'id': '8a754a16-0027-3a29-b6d7-2b40ea0481ed', 'name': 'United Kingdom'}, 'date': '1997-05-26'}], 'id': '3a6b3e7e-cfed-4c4a-b656-701fe3457cd1', 'title': 'Paranoid Android', 'text-representation': {'language': 'eng', 'script': 'Latn'}, 'status': 'Official', 'asin': 'B000006TCH', 'barcode': '724388412421', 'label-info': [{'catalog-number': 'CDNODATA 01', 'label': {'disambiguation': '', 'label-code': 299, 'type': 'Original Production', 'sort-name': 'Parlophone', 'type-id': '7aaa37fe-2def-3476-b359-80245850062d', 'id': 'df7d1c7f-ef95-425f-8eef-445b3d7bcbd9', 'name': 'Parlophone'}}], 'country': 'GB', 'media': [{'format-id': '9712d52a-4509-3d4b-a1a2-67c88c643e31', 'position': 1, 'format': 'CD', 'track-count': 3, 'title': ''}], 'status-id': '4e304316-386d-3409-af2e-78857eec5cfe', 'cover-art-archive': {'count': 0, 'front': False, 'back': False, 'darkened': False, 'artwork': False}, 'quality': 'normal', 'packaging-id': 'f7101ce3-0384-39ce-9fde-fbbd0044d35f', 'date': '1997-05-26', 'disambiguation': 'CD2'}, {'id': '4b1bc218-1de6-43ef-8705-b066a9efe456', 'title': 'Paranoid Android', 'packaging': 'None', 'release-events': [{'area': {'id': '525d4e18-3d00-31b9-a58b-a146a916de8f', 'name': '[Worldwide]', 'iso-3166-1-codes': ['XW'], 'type-id': None, 'disambiguation': '', 'type': None, 'sort-name': '[Worldwide]'}, 'date': '2016-05-13'}], 'status': 'Official', 'asin': 'B01FFT9N44', 'text-representation': {'language': 'eng', 'script': 'Latn'}, 'country': 'XW', 'barcode': '634904080365', 'label-info': [{'catalog-number': 'XLDS803', 'label': {'disambiguation': '', 'label-code': 5667, 'type': 'Original Production', 'sort-name': 'XL Recordings', 'id': '14221f01-8939-4ea0-b8f1-b5a21beae80a', 'name': 'XL Recordings', 'type-id': '7aaa37fe-2def-3476-b359-80245850062d'}}], 'media': [{'position': 1, 'format-id': '9712d52a-4509-3d4b-a1a2-67c88c643e31', 'track-count': 6, 'format': 'CD', 'title': ''}], 'cover-art-archive': {'front': True, 'count': 1, 'back': False, 'artwork': True, 'darkened': False}, 'quality': 'normal', 'status-id': '4e304316-386d-3409-af2e-78857eec5cfe', 'packaging-id': '119eba76-b343-3e02-a292-f0f00644bb9b', 'disambiguation': '', 'date': '2016-05-13'}, {'media': [{'format': 'CD', 'track-count': 1, 'position': 1, 'format-id': '9712d52a-4509-3d4b-a1a2-67c88c643e31', 'title': ''}], 'barcode': None, 'label-info': [{'label': {'label-code': 299, 'disambiguation': '', 'sort-name': 'Parlophone', 'type': 'Original Production', 'id': 'df7d1c7f-ef95-425f-8eef-445b3d7bcbd9', 'name': 'Parlophone', 'type-id': '7aaa37fe-2def-3476-b359-80245850062d'}, 'catalog-number': 'nodatadj 01'}], 'country': 'GB', 'text-representation': {'language': 'eng', 'script': 'Latn'}, 'status': 'Promotion', 'asin': None, 'packaging': None, 'release-events': [{'area': {'iso-3166-1-codes': ['GB'], 'type-id': None, 'id': '8a754a16-0027-3a29-b6d7-2b40ea0481ed', 'name': 'United Kingdom', 'disambiguation': '', 'sort-name': 'United Kingdom', 'type': None}, 'date': '1997-05'}], 'id': '5c375e1c-9545-4b0b-9c87-96de58255bb4', 'title': 'Paranoid Android', 'date': '1997-05', 'disambiguation': '', 'packaging-id': None, 'status-id': '518ffc83-5cde-34df-8627-81bff5093d92', 'cover-art-archive': {'back': False, 'front': False, 'count': 0, 'artwork': False, 'darkened': False}, 'quality': 'normal'}, {'release-events': [{'area': {'name': 'United States', 'id': '489ce91b-6658-3307-9877-795b68554c98', 'type-id': None, 'iso-3166-1-codes': ['US'], 'sort-name': 'United States', 'type': None, 'disambiguation': ''}, 'date': '2009-04-18'}], 'packaging': 'Cardboard/Paper Sleeve', 'title': 'Paranoid Android', 'id': '903e6934-c5d5-4c44-9fd8-548c2b463189', 'text-representation': {'language': 'eng', 'script': 'Latn'}, 'asin': 'B001PCNZAY', 'status': 'Official', 'label-info': [{'label': {'disambiguation': 'imprint of Capitol Records, Inc.', 'label-code': 148, 'type': 'Imprint', 'sort-name': 'Capitol Records', 'type-id': 'b6285b2a-3514-3d43-80df-fcf528824ded', 'id': 'abea2d3e-eabf-4480-ab24-9382dd642c73', 'name': 'Capitol Records'}, 'catalog-number': '509996 93538 19'}], 'barcode': '5099969353819', 'country': 'US', 'media': [{'position': 1, 'format-id': '3e9080b0-5e6c-34ab-bd15-f526b6306a64', 'format': '12" Vinyl', 'track-count': 3, 'title': ''}], 'status-id': '4e304316-386d-3409-af2e-78857eec5cfe', 'cover-art-archive': {'front': False, 'count': 0, 'back': False, 'artwork': False, 'darkened': False}, 'quality': 'normal', 'packaging-id': 'f7101ce3-0384-39ce-9fde-fbbd0044d35f', 'date': '2009-04-18', 'disambiguation': ''}, {'packaging': 'Cardboard/Paper Sleeve', 'release-events': [{'date': '1997-05-26', 'area': {'disambiguation': '', 'sort-name': 'United Kingdom', 'type': None, 'id': '8a754a16-0027-3a29-b6d7-2b40ea0481ed', 'name': 'United Kingdom', 'iso-3166-1-codes': ['GB'], 'type-id': None}}], 'id': 'e4933069-51f2-4b4e-a987-8d9de6802b77', 'title': 'Paranoid Android', 'text-representation': {'language': 'eng', 'script': 'Latn'}, 'status': 'Official', 'asin': 'B0000076JS', 'barcode': '724388412322', 'label-info': [{'label': {'sort-name': 'Parlophone', 'type': 'Original Production', 'label-code': 299, 'disambiguation': '', 'name': 'Parlophone', 'id': 'df7d1c7f-ef95-425f-8eef-445b3d7bcbd9', 'type-id': '7aaa37fe-2def-3476-b359-80245850062d'}, 'catalog-number': 'CDODATAS 01'}], 'country': 'GB', 'media': [{'track-count': 3, 'format': 'CD', 'position': 1, 'format-id': '9712d52a-4509-3d4b-a1a2-67c88c643e31', 'title': ''}], 'status-id': '4e304316-386d-3409-af2e-78857eec5cfe', 'cover-art-archive': {'back': True, 'front': True, 'count': 3, 'artwork': True, 'darkened': False}, 'quality': 'normal', 'packaging-id': 'f7101ce3-0384-39ce-9fde-fbbd0044d35f', 'date': '1997-05-26', 'disambiguation': 'CD1'}]}
D: 10:13:56,717 webservice/ratecontrol._out_of_backoff:231: ('musicbrainz.org', 443): oobackoff; delay: 1000ms -> 1000ms; slow start; window size 6.000 -> 7.000
D: 10:13:59,335 tagger.remove_album:1086: Removing <Album 5c375e1c-9545-4b0b-9c87-96de58255bb4 'Paranoid Android'>
D: 10:13:59,335 file.remove:633: Removing <MP3File '02. Radiohead - Paranoid Android.mp3'> from <Track 9f9cf187-d6f9-437f-9d98-d59cdbd52757 'Paranoid Android'>

I think I know now. :wink:

A = A + 1

instead A=A+1

But A=2 it works without spaces.

@outsidecontext I have no questions yet. :wink: