Skip to content

Instantly share code, notes, and snippets.

View rdswift's full-sized avatar

Bob Swift rdswift

  • Stony Plain, Alberta, Canada
View GitHub Profile
@rdswift
rdswift / MonkeyPythonPicardScripts.md
Created June 30, 2024 17:14
Example Picard Scripts to Create Variables Before Removing Tags

To remove some tags from the files but still have the values available to use in the file naming script, you may first need to save them to temporary variables in a tagging script such as:

$noop( Create temporary variables )
$set(_temp_albumartist,%albumartist%)
$set(_temp_discnumber,%discnumber%)
$set(_temp_totaldiscs,%totaldiscs%)
$set(_temp_compilation,%compilation%)

$noop( Remove unwanted tags )
@rdswift
rdswift / UserAccountStructure.md
Created October 25, 2022 18:15
Example User Account Structure for Multiple Related Sites

Example User Account Structure

The following describes the user account structure used for a sports pool site supporting pools in a number of different sports leagues. This is intended to provide a possible starting point or generate alternative ideas for developing a user account structure for other projects. Note that all sensitive information should be securely stored in an encrypted format.

The basis for the structure developed for the sports pool site was:

  • There is one Account Name per account (e.g. "rdswift"). These Account Names are unique to the entire site database (including all sites). Each account is assigned an Account UUID identifier at the time of creation, which never changes and is used to internally identify the account. This allows the user to change the Account Name and/or Password as part of their login credentials if they choose to do so, while still maintaining the rest of the account settings. Changing an Account Name might be in response to th
@rdswift
rdswift / run_pylint.py
Last active March 14, 2022 22:23
Picard Developer Script to Check Files Using PyLint
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021-2022 Bob Swift
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
@rdswift
rdswift / README.md
Created July 4, 2021 01:01
Log QEvents to File

A simple class to help logging QEvents to a file

To use the QEventFileLogger() in your application:

  1. Include the following definition in the object that you want to log:
    def eventFilter(self, object, event):
        """Process selected events.
 """
@rdswift
rdswift / example_picard_script.pts
Created March 26, 2021 17:33
Example Picard script with genre handling
$noop(
**********************************************************************************
Example Picard script to handle genres.
This script assumes that the genres list is in a normal non multi-value tag
called 'genre', which is provided by Picard if the "Use genres" option is
enabled. This script will produce a new non multi-value variable called
'_genres', which can be converted to a multi-value using the $setmulti
function if required.
@rdswift
rdswift / log2db.py
Last active March 18, 2018 03:27
MusicBrainz Picard 1.4.2 plugin (releaselogger.py) to dump selected CD information to a text file for later import to a database. Python script (log2db.py) to create a SQLite database and populate it from the data dump text file.
"""
Python script used to create the initial (empty) SQLite database
file if required for the music database, and populate the database
from the file generated by the ReleaseLogger plugin for Picard.
Once processed, the source ReleaseLogger data file is appended to
a backup file, and the source file reset to an empty file.
Copyright © 2017, Bob Swift. Released under GPL-2.0 or later.
"""