Jump to content
vitor

WatchList — Play and manage local audiovisual content and streams

Recommended Posts

Update.


Allow quicklook on files and streams.


To update, download the latest version (same URL) or wait a few days and it’ll prompt you to on next usage, since it uses OneUpdater.

Share this post


Link to post

Several updates.

  • Change: Playing without marking as watched now uses ⌃ instead of ⌘.
  • New: ⌘↵ marks as watched (and trashes) without playing. Reopens list in same sort mode.
  • New: Use quicklook preview in watched list items that have an origin URL.
  • New: Different trashing mechanism. You shouldn’t notice a difference in behaviour, but it removes a dependency.


To update, download the latest version (same URL) or wait a few days and it’ll prompt you to on next usage, since it uses OneUpdater.
 

Share this post


Link to post

Update.


Fix deleting paths with single quotes.


To update, download the latest version (same URL) or wait a few days and it’ll prompt you to on next usage, since it uses OneUpdater.
 

Share this post


Link to post

Update.

 

Let Alfred filter results in wlu.


To update, download the latest version (same URL) or wait a few days and it’ll prompt you to on next usage, since it uses OneUpdater.
 

Share this post


Link to post

Update.


Fix for case where trying to play the same item twice could lead to list corruption.


To update, download the latest version (same URL) or wait a few days and it’ll prompt you to on next usage, since it uses OneUpdater.
 

Share this post


Link to post

I decided to hop on the bandwagon and give this a try today and it's spitting back the following error when I try to play an item:

[00:33:41.490] ERROR: WatchList[Run Script] /Users/Brad/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.8A7FDDB5-5037-4878-A927-CB706D0B9751/watchlist_functions.rb:385:in `block in play_item': undefined method `+' for nil:NilClass (NoMethodError)
	from /Users/Brad/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.8A7FDDB5-5037-4878-A927-CB706D0B9751/watchlist_functions.rb:395:in `play_item'
	from /Users/Brad/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.8A7FDDB5-5037-4878-A927-CB706D0B9751/watchlist_functions.rb:300:in `play'
	from /Users/Brad/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/D157EE3F-E0E6-4693-9A97-53231258EB81:3:in `<main>'

Running on macOS 10.15.2 and Alfred 4.0.7. Am I missing some sort of Ruby dependency?

Share this post


Link to post
7 hours ago, buffaloseven said:

Am I missing some sort of Ruby dependency?

 

No, the Workflow doesn’t have any. It was a bug. Fixed on the latest version (just released).

Share this post


Link to post

Thanks for the quick response. I updated to the latest version and now get this error:

[21:53:34.208] ERROR: WatchList[Run Script] /Users/Brad/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.8A7FDDB5-5037-4878-A927-CB706D0B9751/watchlist_functions.rb:386:in `exist?': no implicit conversion of nil into String (TypeError)
	from /Users/Brad/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.8A7FDDB5-5037-4878-A927-CB706D0B9751/watchlist_functions.rb:386:in `block in play_item'
	from /Users/Brad/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.8A7FDDB5-5037-4878-A927-CB706D0B9751/watchlist_functions.rb:395:in `play_item'
	from /Users/Brad/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.8A7FDDB5-5037-4878-A927-CB706D0B9751/watchlist_functions.rb:300:in `play'
	from /Users/Brad/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/44CE6029-3DF0-438B-AC11-5478A7281816:3:in `<main>'

EDIT: I was able to solve the problem by coercing the Nil value returned by the mdfind capture to a string, which then played nicely with the Dir.exist? call. My code looks like this:

  # The 'split' together with 'last' serves to try to pick the last installed version, in case more than one is found (multiple versions in Homebrew Cellar, for example)
  video_player = lambda {
    mpv = Open3.capture2('mdfind', 'kMDItemCFBundleIdentifier', '=', 'io.mpv').first.strip.split("\n").last.to_s
    return [mpv + '/Contents/MacOS/mpv', '--quiet'] if Dir.exist?(mpv)

    iina = Open3.capture2('mdfind', 'kMDItemCFBundleIdentifier', '=', 'com.colliderli.iina').first.strip.split("\n").last.to_s
    return iina + '/Contents/MacOS/IINA' if Dir.exist?(iina)

    vlc = Open3.capture2('mdfind', 'kMDItemCFBundleIdentifier', '=', 'org.videolan.vlc').first.strip.split("\n").last.to_s
    return vlc + '/Contents/MacOS/VLC' if Dir.exist?(vlc)

    return 'other'
  }.call

 

Edited by buffaloseven

Share this post


Link to post
8 hours ago, buffaloseven said:

by coercing the Nil value returned by the mdfind capture to a string

 

That’s unnecessary and leads to more code. We can make it less code by getting rid of Dir.exist?. I’ve done so in the just released update.


Thinking about it today, the bugs were introduced when I changed the code to allow for multiple installations of the same player. That’s an uncommon situation, but it can happen.

Share this post


Link to post
On 12/29/2019 at 6:56 AM, vitor said:

 

That’s unnecessary and leads to more code. We can make it less code by getting rid of Dir.exist?. I’ve done so in the just released update.


Thinking about it today, the bugs were introduced when I changed the code to allow for multiple installations of the same player. That’s an uncommon situation, but it can happen.

 

Haha, sounds good to me. I'm not a coder by trade or anything like that, so I tend to just find band-aids. I'm glad you were able to make a better solution than what I did 🙂

Share this post


Link to post
On 2/4/2020 at 2:12 AM, buffaloseven said:

Haha, sounds good to me. I'm not a coder by trade or anything like that, so I tend to just find band-aids. I'm glad you were able to make a better solution than what I did 🙂

 

You still found the bug and a way to fix it, so thank you!

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...