ryanvilbrandt / comic_git

A statically-hosted web comic server core intended to be hosted on github.io. For help getting started, click the Wiki link above!
23 stars 7 forks source link

Transcripts folder can't be empty #52

Closed shirgoldbird closed 3 years ago

shirgoldbird commented 3 years ago

Transcripts will not appear if the following option in comic_info.ini does not have a value:

Transcripts folder =

(Note, this is how it's set in the default comic_git build.)

This problem is caused by this bit of build_site.py:

transcripts_dir = get_option(
        comic_info, "Transcripts", "Transcripts folder", default=f"your_content/{comic_folder}comics"
    )

get_option returns an empty string instead of the default value, because if comic_info.has_option(section, option) evaluates to true (as the comic_info.ini file does have both a "Transcripts" section and a "Transcripts folder" option. But the code doesn't check to make sure a value is actually set, so it returns the empty string/null value that is there.

This can be fixed by removing the Transcripts folder= line entirely, or by adding another check to the get_option function to make sure properties have a non-null value, and returning the default if not.