Create a command string from the config command and optional args.
(self, args=None)
| 173 | play(command_str, selection, paths, open_args, self._log, item_type) |
| 174 | |
| 175 | def _command_str(self, args=None): |
| 176 | """Create a command string from the config command and optional args.""" |
| 177 | command_str = config["play"]["command"].get() |
| 178 | if not command_str: |
| 179 | return util.open_anything() |
| 180 | # Add optional arguments to the player command. |
| 181 | if args: |
| 182 | if ARGS_MARKER in command_str: |
| 183 | return command_str.replace(ARGS_MARKER, args) |
| 184 | return f"{command_str} {args}" |
| 185 | # Don't include the marker in the command. |
| 186 | return command_str.replace(f" {ARGS_MARKER}", "") |
| 187 | |
| 188 | def _playlist_or_paths(self, paths): |
| 189 | """Return either the raw paths of items or a playlist of the items.""" |
no test coverage detected