Skip to content

Releases: svioletg/lydian

v0.10.0

v0.10.0 Pre-release
Pre-release

Choose a tag to compare

@svioletg svioletg released this 28 Jul 20:52

v0.9.1...v0.10.0

Overview

Breaking changes

  • The debug console command read has been renamed to eval
  • YouTube text search is now supported
    • Configure how many results to choose from are shown with the max_search_results config key
  • Config key media_filter.allowed_urls is now media_filter.allowed_queries
  • Tracks can now be looped via the -loop command
  • You can now have the bot prompt for confirmation when using -remove by setting the
    confirm_on_remove config key to true

Added

  • Added bot command -loop (method cogs.voice.VoiceCog.toggle_loop()) (#34)
  • Added debug bot command -buttons
  • Added config key confirm_on_remove (bool)
    • If true, using -remove will prompt the user to confirm their choice
  • Added config key max_search_results (#39)
  • Added title named group to markdown header regexes in const
    • const.MD_HEADER_REGEX
    • const.MD_H1_REGEX
    • const.MD_H2_REGEX
    • const.MD_H3_REGEX
  • Added tool module tools.testdataytdl
  • Added enum member const.EmojiStr.LOOP (#34)
  • Added enum member const.EmojiStr.LOOP_ONE (#34)
  • Added attribute cogs.voice.MediaItem.uploader
  • Added attribute cogs.voice.VoiceCog.loop (#34)
  • Added class cogs.util.DynamicButtonsView
  • Added constant const.EMOJI_DIGITS
  • Added constant const.HTTP_REGEX
  • Added constant const.YTDL_SEARCH_PREFIX_REGEX (#39)
  • Added classmethod const.EmojiStr.from_int()
  • Added parameter confirm_callback to method cogs.voice.MediaItem.from_url()
    • Takes a function which receives the tuple of constructed MediaItem objects and must return
      True for the method to return those objects, returning an empty tuple if False
  • Added method cogs.voice.VoiceCog.loop_state_embed() (#34)
  • Added method cogs.voice.VoiceCog._prompt_media_item_choice() (#39)
  • Added function util.group_by()
  • Added function util.nop()
    • "No-op"; takes any arguments and keyword arguments and does nothing
  • Added function util.nop_ret()
    • Returns a function with takes any arguments and keyword arguments and returns a specified value
    • util.nop_true and util.nop_false also added for convenience which return True and False
      respectively
  • Added mock function tests.conftest.mock_ytdl()
  • Added proper handling for discord.ext.commands.errors.BadLiteralArgument in
    bot.on_command_error()

Changed

  • Renamed config key media_filter.allowed_queries
  • Renamed console command debug read to debug eval
  • Renamed attribute config.MediaFilterConfig.allowed_urls to .allowed_queries
  • Renamed method console.LydianConsole.debug_read() to .debug_eval()
  • Renamed method config.Config.filter_media_url() to .filter_query_url()
  • Renamed function util.assure() to asserts()
  • util.asserts() now raises the builtin AssertionError instead of the now-removed custom
    exception errors.AssuranceError
  • Method cogs.util.DropdownView.__init__() parameter options now accepts Iterable instead of
    just list
  • util.Cache objects can now be effectively disabled with the enabled attribute, which prevents
    setting keys and retrieving keys from its data dictionary
  • Multiple methods in MediaItem now use .get(...) or ... instead of setting a default for
    .get() in yt-dlp extracted info dictionary usage
  • Method cogs.voice.VoiceCog.play() now takes a variable argument query_parts instead of url
    (#39)
    • This allows queries with spaces to be used as one whole string
  • Attribute cogs.voice.VoiceCog._play_calls now requires a third item for its tuples: either
    'url' or 'search' (#39)
  • Method cogs.voice.VoiceCog._try_to_queue() now takes an optional choose parameter (#39)
    • Prompts the user to choose one track to queue out of the extracted items
  • Various messages that mention a URL in queueing now mention "query" since searching is supported
    (#39)

Removed

  • Removed class tests.ReadOnlyDict
  • Removed exception errors.AssuranceError
  • Removed exception tests.ReadOnlyModifiedError
  • Removed function tests._raise_for_readonly()

Fixed

  • Fixed markdown header regexes matching more header symbols than intended, they now correctly match
    only their respective header level
  • Fixed check_for_stable_only config key not getting checked when checking updates at bot startup
    (#42)

v0.9.1

v0.9.1 Pre-release
Pre-release

Choose a tag to compare

@svioletg svioletg released this 21 Jun 19:06

v0.8.0...v0.9.1

This release is intended to replace the now-yanked v0.9.0, which due to improper merging did not contain any of the intended changes.

Overview

  • Vote-skipping is now supported, optionally requiring a minimum number of users (a percentage of
    the channel or an exact count) to use -skip before the current track is skipped. (#16)
    • To use it, add the [vote_skipping] table to your lydian-config.toml like below and adjust
      the values as desired.
[vote_skipping]
enabled = true
threshold_type = "percentage"
percentage = 50
literal = 3

Added

  • Added debug console command debug store
  • Added debug bot command -dropdown (method cogs.debug.DebugCog.dropdown())
  • Added module help
  • Added constant const.DOCSTRING_PARAM_REGEX
  • Added constants const.GH_CHANGELOG_WEB and const.GH_CHANGELOG_RAW
  • Added constants to const:
    • MD_HEADER_REGEX
    • MD_H1_REGEX
    • MD_H2_REGEX
    • MD_H3_REGEX
  • Added enum members const.EmojiStr.BACK and const.EmojiStr.GEAR
  • Added classes cogs.util.ArrowButtonsView and cogs.util.DropdownView
  • Added class cogs.voice.VoteSkip
  • Added attribute cogs.voice.MediaItem.user_id to replace .user
  • Added method console.LydianConsole._debug_evaluate_in_context()
  • Added functions to cogs.util:
    • cog_emoji()
    • command_signature()
    • paginated_message()
  • Added functions to util:
    • cog_commands()
    • getclass()
    • get_text_sections()
    • mention()
  • Added pytest fixtures mock_bot and mock_discord_user

Changed

  • util.dirsize() now only counts file sizes and ignores directories
  • cogs.voice.MediaItem objects now store who queued the item as their int user ID rather than
    the actual discord.Member object, which allows them to be deep-copied
  • Moved update.GH_API_ROOT, update.GH_REPO_API_ROOT, and update.USER_AGENT to const
    • Value of USER_AGENT updated to use the package's name instead of lydian-update-checker
  • Swapped arguments of util.first_where() to make the predicate first, matching built-ins like
    map and filter

Removed

  • Removed attribute cogs.voice.MediaItem.user, (replaced by .user_id)

Fixed

  • Fixed cogs.voice.MediaItem objects always refreshing when advancing queue if their
    thumbnail_url attribute is truthy (incorrectly wrote
    (not item.duration) or (item.thumbnail_url) instead of
    (not item.duration) or (not item.thumbnail_url))
  • Fixed ZoneInfo not working correctly on systems without an IANA database by including tzdata
    as a dependency

v0.8.0

v0.8.0 Pre-release
Pre-release

Choose a tag to compare

@svioletg svioletg released this 05 Jun 23:53

v0.7.0...v0.8.0

Overview

Breaking changes:

  • Some TOML configuration keys are now properly nullable, using the 'n/a' value to indicate
    such.
    • Config keys max_duration, media_dir_warn_threshold, inactivity_timeout, and
      lonely_timeout now use 'n/a' instead of -1 or 0 to indicate they should be disabled

  • Lydian can now optionally check for new releases at startup, toggled with the check_for_updates
    configuration key (or LYDIAN_CHECK_UPDATES environment variable).
    • You can check for updates manually by running lydian-update.
    • By default, pre-releases are skipped during this check. Set the check_for_stable_only config
      key to false to include pre-releases.
  • The media queue now has a shuffle mode, use -shuffle <on|off> to enable or disable it.
  • Lydian now includes exception arguments in "unexpected error" messages.
    • Full tracebacks are still only available in Lydian's logs.
  • A temporary (deletes after 10 seconds) message is now sent when skipping a track

Added

  • Added config key bot_console (boolean)
    • env: LYDIAN_BOT_CONSOLE
  • Added config key check_for_updates (boolean)
    • env: LYDIAN_CHECK_UPDATES
  • Added config key check_for_stable_only (boolean)
    • env: LYDIAN_CHECK_STABLE_ONLY
  • Added console commands version and updates
  • Added module update
  • Added debug bot commands -argstr and -argint
  • Added bot commands:
    • -issues
    • -repo
    • -shuffle
  • Added attribute cogs.voice.VoiceCog.shuffle
  • Added attributes converter_env and converter_toml to config.ConfigFieldMeta
  • Added command methods cogs.debug.DebugCog.argstr() and cogs.debug.DebugCog.argint()
  • Added command methods cogs.general.GeneralCog.repo() and cogs.general.GeneralCog.issues()
  • Added command method cogs.voice.VoiceCog.toggle_shuffle()
  • Added method console.LydianConsole.version()
  • Added classmethod tools.todos.Todo.parse_todos()
    • Parses Todo objects directly from a string without needing file paths
  • Added method tools.todos.Todo.with_file()
  • Added function util.exc_str()

Changed

  • Package version is now set dynamically using __version__ from __init__.py
  • Bot command -hello now accepts aliases
  • The discord.py exceptions BadArgument and MissingRequiredArgument are now properly handled
  • Logging methods in cogs.voice.YTDLLogHandler now log with depth=2 for more accuracy
  • Renamed in const:
    • COLOR_INFOEMBED_COLOR_INFO
    • COLOR_OKEMBED_COLOR_OK
    • COLOR_WARNEMBED_COLOR_WARN
    • COLOR_ERROREMBED_COLOR_ERROR
  • A status message is now sent when retrieving info for a track before downloading begins (#30)
  • Tool todos now accepts multiple directories to search
  • In tools.todos:
    • Todo.content is now an attribute and not a method
    • Todo.header is now a cached property and no longer accepted as a constructor argument
    • Todo.file is now an optional attribute
    • find_todos() now takes a variable positional argument paths instead of the single
      positional argument source_dir, still str | Path
  • Moved function config.env_to_bool() to util.FromStr.to_bool()
  • Renamed classmethod util.FromStr.filesize() to util.FromStr.to_filesize()
  • Unexpected errors caught in bot.on_command_error now have their exception args sent along with
    the bot's message instead of only saying to check the logs

Fixed

  • Fixed util.tabulate() raising an error for empty data (#32)
  • Fixed todos dev tool skipping # TODO lines with no author (#33)

v0.7.0

v0.7.0 Pre-release
Pre-release

Choose a tag to compare

@svioletg svioletg released this 25 May 21:55

v0.6.1...v0.7.0

Overview

Breaking changes:

  • TOML configuration keys now use underscores (_) instead of hyphens (-)
  • Config key log_level under logging is now level

  • [feature] A duration limit for media items can now be set using the max-duration config key, which
    specifies the limit in seconds using a positive integer (setting to 0 will disable the limit)
    • max-duration-allow-unknown specifies whether tracks with an unknown duration can be played
      or not when a duration limit is in place, defaulting to false
      • If no limit is set, this key is unused and tracks of unknown duration are always allowed
      • To save time on queueing, Lydian does not fetch a track's duration until it needs to, meaning
        items queued from a playlist URL won't have their duration checked against the limit until
        they are next in line
  • [feature] lydian can now be run with the -V or --version option to display the installed Lydian
    version and exit without starting the bot
  • [feature] The "now playing" view now shows the approximate current timestamp of the playing media
    (#13)
    • Slight network delays will likely cause this number to be slightly inaccurate, but it should
      remain close enough for reference
  • [fix] Fixed filesize strings in the config with single digits raising an error due to a typo in the
    regex used to match them

Added

  • Added the -V/--version option to the lydian package command
    • When used, Lydian's version is printed out and the script immediately exits
  • Added config key max-duration (integer)
  • Added config key max-duration-allow-unknown (boolean)
  • Added class config.Config.ConfigField
  • Added class config.Config.ConfigFieldMeta
  • Added method config.Config.set()
  • Added property config.Config.fields
  • Added function util.compose()
  • Added support for validator functions in config.Config fields, which can be given with the
    'validators' key of a given field's metadata argument as a single function or iterable of
    functions

Changed

  • Having debug mode enabled no longer forces the log level to "DEBUG" level
  • cogs.voice.MediaItem.duration_str now returns ?:?? for an unknown duration instead of None
  • cogs.voice.MediaItem.embed() now accepts an optional timestamp keyword argument to show the
    current time alongside its duration
  • TOML configuration keys are now in snake_case instead of kebab-case; though the latter is more
    common in TOML, it's ultimately unnecessary to keep converting keys between the two cases where
    needed
  • const.LogLevel is now an IntEnum subclass instead of StrEnum
  • config.Config updating and loading from TOML is now handled in the class itself in a simpler
    fashion than using util.DataclassUpdateMixin (#26)

Removed

  • Removed mixin class util.DataclassUpdateMixin
    • Only used for updating the configuration object, which now handles updating in its own class

Fixed

  • Fixed single-digit filesize numbers in TOML config not matching pattern
  • Queue no longer stops when encountering an error, will now skip problematic items until one can be
    played or the queue is empty (#25)

v0.6.1

v0.6.1 Pre-release
Pre-release

Choose a tag to compare

@svioletg svioletg released this 25 May 20:38

v0.6.0...v0.6.1

Fixed

  • Fixed Lydian completely failing on Windows due to an issue with a path highlighter (#28)

v0.6.0

v0.6.0 Pre-release
Pre-release

Choose a tag to compare

@svioletg svioletg released this 20 May 01:54

This is the first public pre-release version for Lydian.

Lydian is currently in a beta state, before its v1.0.0 release it may be unstable or subject to a number of bugs. Pre-releases should work reasonably well, but it should likely be kept to smaller servers for the time being. Below is a basic user-facing overview of Lydian's current commands and features; more detail can be found in Lydian's full changelog, and a longer overview of the project and how to use the bot is at the README.

General features

Bot commands

"Author" or "command author" refers to the user issuing the command.
Arguments surrounded by angle brackets (<>) are required, while arguments in square brackets ([]) are optional. Brackets should not be included in the actual argument values.

-join

Joins the author's voice channel if they are connected to one, leaving the voice channel it was previously in if applicable. Typically unnecessary to use, as -play will make the bot do this automatically if not connected already.

-leave

Leaves the voice channel the bot is connected to, if any. The user issuing this command must be in the same voice channel as the bot.

-play

If not given a URL, tries to resume a paused or stopped player. Otherwise, the URL is added to the bot's queue, playing immediately if the queue was previously empty.

-pause

Pauses the player. Can be resumed with -play.

-stop

Stops the player. This behaves like most media players do, meaning the currently playing track is saved and will be played from the beginning of -play is used again after stopping.

-skip

Skips the currently item (whether playing, paused, or stopped), starting the next item in the queue if one exists.

-nowplaying

Shows what's currently playing.

-queue [page]

Shows the queue. If the queue is longer than 20 items, it will be separated into pages, where a specific page can be viewed with -queue 2, -queue 3, etc.

-remove <index>

Removes an item at the index position of the queue.

-move <from> <to>

Moves an item from position from of the queue to position to.

-clear

Removes every item from the queue, leaving it empty.

-help

Shows a list of every command available and a brief description of it. This is very bare at the moment, and will be much more user-friendly in the future (#18).