Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create terminal command to fill out metadata faster #15

Open
RustoMCSpit opened this issue Nov 22, 2024 · 11 comments
Open

create terminal command to fill out metadata faster #15

RustoMCSpit opened this issue Nov 22, 2024 · 11 comments
Assignees
Labels
enhancement New feature or request

Comments

@RustoMCSpit
Copy link
Contributor

RustoMCSpit commented Nov 22, 2024

i can imagine that having a simple successive input questionnaire that outputs a file would speed up the metadata process

select file (automatically checks or builds checksums, architecture, etc.):
name:
author:
etc.
@RustoMCSpit
Copy link
Contributor Author

it would also lower the bar for adoption which is key

@kmturley
Copy link
Member

StudioRack has this feature for creating projects:
studiorack project create

In code
https://github.com/studiorack/studiorack-core/blob/main/src/project.ts#L16

I think it's a good idea to add for plugins too

@RustoMCSpit
Copy link
Contributor Author

RustoMCSpit commented Nov 22, 2024

StudioRack has this feature for creating projects: studiorack project create

In code https://github.com/studiorack/studiorack-core/blob/main/src/project.ts#L16

I think it's a good idea to add for plugins too

not only plugins, presets, chords, projects, etc.

@RustoMCSpit
Copy link
Contributor Author

off topic, how do authors confirm their identity when uploading data to the registry? id be worried if someone authorised something under someone elses name.

furthermore, is open audio able to use the github api to fill in new data after an update after the plugin is first uploaded like https://github.com/ImranR98/Obtainium

@DropSnorz
Copy link

off topic, how do authors confirm their identity when uploading data to the registry? id be worried if someone authorised something under someone elses name.

I think it's ok to allow everyone to add/update metadata about any plugins. Submissions in PR should be manually reviewed to ensure relevance and files targets official distribution sources.

@RustoMCSpit
Copy link
Contributor Author

https://github.com/RustoMCSpit/awesome-linux-clap-list

heres a huge list of foss plugins, then again i know you also keep a list in the studiorack project https://github.com/orgs/studiorack/projects/2

@RustoMCSpit
Copy link
Contributor Author

I think it's ok to allow everyone to add/update metadata about any plugins

open-audio-stack/open-audio-stack-core#7
would be necessary actually

@RustoMCSpit
Copy link
Contributor Author

!/bin/bash

# Create a YAML file name (default: index.yaml)
YAML_FILE="index.yaml"

echo "Creating index.yaml file..."

echo "Writing metadata to $YAML_FILE..."

# Ask user for metadata points one by one
read -p "Name: " NAME
read -p "Author: " AUTHOR
read -p "Description: " DESCRIPTION
read -p "License: " LICENSE
read -p "Type: " TYPE
read -p "Tags (comma-separated): " TAGS
read -p "URL: " URL
read -p "Audio file link (FLAC, optional) or other extension: " AUDIO_FILE
read -p "Image file link (JPEG, optional) or other extension: " IMAGE_FILE
read -p "Date (YYYY-MM-DD HH:mm:ss): " DATE

# Ask about changes
echo "Please specify the changes (comma-separated):"
read -p "Changes: " CHANGELOG

CHANGES_LIST=$(echo "$CHANGELOG" | tr ',' '\n')

# Define the binary section of YAML as an empty string and add to it as needed.
BINARY_SECTION=""

# Add starting metadata
cat <<EOF >> $YAML_FILE
name: ${NAME}
author: ${AUTHOR}
description: ${DESCRIPTION}
license: ${LICENSE}
type: ${TYPE}
tags:
  - ${TAGS}
url: ${URL}
audio_file: ${AUDIO_FILE:-null}
image_file: ${IMAGE_FILE:-null}
date: '${DATE}'
changes:
EOF

# Ask about binaries
echo "Please specify the availability of binaries:"
echo "(1) Linux (.zip) or other archive"
echo "(2) Mac (.zip) or other archive"
echo "(3) Windows (.zip) or other archive"
echo "(4) I'm done inputting binaries"
while true; do
    read -p "Specify binary type (1, 2, 3, or 4): " BINARY_TYPE
    case $BINARY_TYPE in
        1)
            echo "Linux binary:"
            read -p "File URL: " LINUX_FILE_URL

            # Wait for user confirmation to download and add file info
            while true; do
                read -p "Confirm to download ${LINUX_FILE_URL} (y/n): " confirm
                if [ "$confirm" = "y" ]; then
                    CURL_FLAGS="-f --remote-time --show-error"
                    LINUX_LOCAL_PATH=$(curl -s -o /dev/null -w "%{size_download},%{hash_sha256}" ${CURL_FLAGS} ${LINUX_FILE_URL})

                    # Check for errors in downloading the file
                    if [ $? -ne 0 ]; then
                        echo "Error downloading Linux binary. Skipping..."
                        break;
                    fi

                    SIZE_LNX=$(echo "$LINUX_LOCAL_PATH" | cut -d',' -f1)
                    LINUX_HASH=$(echo "$LINUX_LOCAL_PATH" | cut -d',' -f2)

                    cat <<EOF >> $YAML_FILE
files:
- systems:
    - type: linux
  architectures:
    - x64
  contains:
    - clap
    - deb
    - vst3
  format: tar.gz
  type: archive
  size: ${SIZE_LNX}
  sha256: ${LINUX_HASH}
  url: ${LINUX_FILE_URL}
EOF

                    break;
                elif [ "$confirm" = "n" ]; then
                    echo "Skipping Linux binary."
                    break;
                else
                    echo "Invalid input. Please confirm with 'y' or 'n'."
                fi
            done

        ;;
        2)

            # Wait for user confirmation to download and add file info
            while true; do
                read -p "Confirm to download ${MAC_FILE_URL} (y/n): " confirm
                if [ "$confirm" = "y" ]; then
                    CURL_FLAGS="-f --remote-time --show-error"
                    MAC_LOCAL_PATH=$(curl -s -o /dev/null -w "%{size_download},%{hash_sha256}" ${CURL_FLAGS} ${MAC_FILE_URL})

                    # Check for errors in downloading the file
                    if [ $? -ne 0 ]; then
                        echo "Error downloading Mac binary. Skipping..."
                        break;
                    fi

                    SIZE_MAC=$(echo "$MAC_LOCAL_PATH" | cut -d',' -f1)
                    MAC_HASH=$(echo "$MAC_LOCAL_PATH" | cut -d',' -f2)

                    cat <<EOF >> $YAML_FILE
files:
- systems:
    - type: mac
  architectures:
    - arm64
    - x64
  contains:
    - clap
    - vst3
  format: zip
  type: archive
  size: ${SIZE_MAC}
  sha256: ${MAC_HASH}
  url: ${MAC_FILE_URL}
EOF

                    break;
                elif [ "$confirm" = "n" ]; then
                    echo "Skipping Mac binary."
                    break;
                else
                    echo "Invalid input. Please confirm with 'y' or 'n'."
                fi
            done

        ;;
        3)

            # Wait for user confirmation to download and add file info
            while true; do
                read -p "Confirm to download ${WIN_FILE_URL} (y/n): " confirm
                if [ "$confirm" = "y" ]; then
                    CURL_FLAGS="-f --remote-time --show-error"
                    WIN_LOCAL_PATH=$(curl -s -o /dev/null -w "%{size_download},%{hash_sha256}" ${CURL_FLAGS} ${WIN_FILE_URL})

                    # Check for errors in downloading the file
                    if [ $? -ne 0 ]; then
                        echo "Error downloading Windows binary. Skipping..."
                        break;
                    fi

                    SIZE_WIN=$(echo "$WIN_LOCAL_PATH" | cut -d',' -f1)
                    WIN_HASH=$(echo "$WIN_LOCAL_PATH" | cut -d',' -f2)

                    cat <<EOF >> $YAML_FILE
files:
- systems:
    - type: win
  architectures:
    - x64
  contains:
    - clap
    - vst3
  format: zip
  type: archive
  size: ${SIZE_WIN}
  sha256: ${WIN_HASH}
  url: ${WIN_FILE_URL}
EOF

                    break;
                elif [ "$confirm" = "n" ]; then
                    echo "Skipping Windows binary."
                    break;
                else
                    echo "Invalid input. Please confirm with 'y' or 'n'."
                fi
            done

        ;;
        4)
            echo "Skipping binaries."
            exit 0
        *)
            echo "Invalid input. Please try again."
        esac
    done <&0 || exit 99

im too lazy and incompetent to fix this lol. forgive me.

@RustoMCSpit
Copy link
Contributor Author

RustoMCSpit commented Dec 16, 2024

current issues:

1)) it doesnt check if it's a project preset or plugin
2) it's bash so i dont know if it works on windows
3) it cant even download a file yet (heres a basic script to do that)

#!/bin/bash

echo "Do you want to download the file? (Y/N)"

read -n 1 answer

if [ "$answer" = "Y" ] || [ "$answer" = "y" ]; then
    curl -LO https://github.com/igorski/delirion/releases/download/1.1.0/delirion.1.1.0_macos.zip
else
    echo "No download initiated."
fi

3.5) even if it could download files it would have no idea what they are named to do checksum and file size
4) doesnt create proper file structure
5) tags arent properly implemented and they should be sorted alphabetically automatically as well as capitalised
6) needs npm check
7) changelog poorly implemented
8) need to remove unnecessary spaces after inputs
9) need to work on how images and audio get sorted as currently you provide a url but it should make the url automatically and just need to be linked to it locally
10) check what each file contains (currently is just hardcoded to assume .clap and such)
11) need to clear screen after prompts
12) need short cuts (e.g. e for effect, i for instrument)
13) needs to work with both local files and downloading files
14) bizarre way of selecting linux mac windows and if you do not input it in the right order it will structure it wrong in the .yaml
15) barely any type checking, will break easily (time should also be re-arranged when inputted)

@RustoMCSpit
Copy link
Contributor Author

RustoMCSpit commented Dec 16, 2024

use the below as a testing kit:

delirion
igorski
A multiband Doppler-based chorusing/detune effect 
gpl-3.0
effect
chorus, detune, effect
https://github.com/igorski/delirion


https://open-audio-stack.github.io/open-audio-stack-registry/plugins/igorski/delirion/delirion.flac
https://open-audio-stack.github.io/open-audio-stack-registry/plugins/igorski/delirion/delirion.jpg

2024-09-06 00:00:00Z  

First stable release (featuring post-first release addition of LFO sync)., Built against JUCE 8.0.1


https://github.com/igorski/delirion/releases/download/1.1.0/delirion.1.1.0_macos.zip

delirion.1.1.0_macos.zip

https://github.com/igorski/delirion/releases/download/1.1.0/delirion.1.1.0_windows.zip

delirion.1.1.0_windows.zip

@RustoMCSpit
Copy link
Contributor Author

RustoMCSpit commented Dec 16, 2024

@kmturley ive no idea if youve any knowledge with bash but if i get this working as i want to i can add 100 plugins in an hour. i havent coded in ages and that was largely ai helping me out (though i have been working on it for hours lol)

however, this is not a priority and you should just ignore all my issues until you get this done https://github.com/orgs/open-audio-stack/projects/2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

3 participants