Jump to content

Watch List — Play and manage local media and streams


Recommended Posts

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.
 

Link to comment
  • 1 month later...
  • 5 weeks later...
  • 1 month later...

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?

Link to comment

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
Link to comment
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.

Link to comment
  • 1 month later...
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 🙂

Link to comment
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!

Link to comment
  • 1 month later...
  • 3 weeks later...

Update.

 

Two interfacing changes.

  1. When marking an item as watched without playing, do not refresh Alfred.
  2. When playing an item, do not close Alfred.

Both changes are meant to allow acting on multiple items fast. For example, when opening a video, the player will steal focus from Alfred and close it anyway, but until then you have the chance to ↵ on other items, setting up a short queue.


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.
 

Link to comment

Updates.

  • Checking for audiovisual contents happens before moving directory.
  • move_on_add takes a full path, instead of relative to home (~ works).

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.

Link to comment
  • 1 month later...
  • 2 months later...

Update.


Detect mpv installations even when only the CLI is installed. It only searches Homebrew default paths (/usr/local/bin/mpv and /opt/homebrew/bin/mpv).


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.

Edited by vitor
Link to comment

Update.


Added something I’ve been thinking about for quite some time: a quick playlist feature.

 

You may have noticed that Alfred’s windows doesn’t immediately close when playing an item through the WatchList. That was a cheat to allow for quick actioning of something else, to play multiple items in succession. No more!

 

Now, use ⇧↵ to add an item to a quick playlist. After adding everything you want, press ↵ and they will play in order. If you add to a playlist but don’t action it for a few minutes (3, currently), it will be ignored when you add another item, effectively starting from scratch.

 

Just built the feature, so it may suffer some adjustments as I test it out more.


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.

Edited by vitor
Link to comment

Updates.

 

  • If possible, items are recovered from trash on marking unwatched. If successful, you’ll hear a sound. If not, you’ll get a notification with the reason.
  • Changed the error sound. 
  • Made some code cleanup to better handle a few cases.


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.

Link to comment
  • 1 month later...

Update.


When a path is deleted, if there’s another with the same name in the Trash, the new one will have the date appended. This new version keeps track of the new name so it can recover it accurately.


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.

Link to comment

Update.

 

Removed the swl Keyword (always felt it was a clunky way to do it) and replaced it with a Universal Action. Added another for adding the URL and playing it immediately.


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.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...