Add option to only display titles for web entries #44
+13
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I added a new
url
option for theuse_titles
option in the config.When
use_titles=url
is set, the script will only display titles for web entries (e.g., YouTube or Vimeo URLs) and fall back to filenames for everything else. It leverages the fact that the config options are set as strings, so this shouldn't break existing configs. I also changed the default config file to make the options for this more clear.Decided to add this because I use
no
so I can see the specific filenames of items, but when I do that, Youtube URLs offer absolutely no info.I saw what was said in #12, so I made sure that this change is based on the script's already existing logic for determining the protocol. So far, I only have it set to detect ytdl, http, and https as URLs. More protocols can easily be added to the list if necessary. And if you think the use of the term "URL" is too liberal (since that could refer to FTP too) I can always change the variable and setting names to "web" or something instead.
One other change I could make is to update every other call of
path_info()
to include theis_url
variable. That would make it clearer what the outputs of the function are for future maintainers.