Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notifications (for linux too!) #1

Merged
merged 8 commits into from Dec 6, 2014
Merged

Notifications (for linux too!) #1

merged 8 commits into from Dec 6, 2014

Conversation

winterthediplomat
Copy link
Contributor

h RoxasShadow.
I worked a bit on notifications: TerminalNotifier is mac-only, so I couldn't run it on my xubuntu dev vbox.
To address this problem (and achieve cross-platform notifications) I added a new class Notifier which spawn (with Notifier#getNotifier) the correct notifier according to the OS Miyuki is running on.
Actually, only Linux and Mac OS X 10.8+ are supported, take your time to investigate Windows alternatives.

A thing it could be ok to work on should be installing only the right dependency (TerminalNotifier on mac, libnotify on linux, libwhatever on windows) and include it in lib/miyuki.rb, instead of downloading 3 or more libraries and use just one of those.

This PR also fixes a bug in the comparison of torrents (to check if there are new torrents), but in the wrong way. The best way is to address this problem in Yamazaki::Torrent and override "==" operator. I would have been more than happy to provide it myself with a PR on Yamazaki, but I wasn't able to test it.

TerminalNotify is OSX-only, and I'm using Linux, so I'm including libnotify for notifications
I was experiencing a strange error. Investigating, I had two different versions of Miyuki (two Miyukis... www): uninstalling them and rebuilding/reinstalling only 0.3 version (this one!) did the trick.
I'm sorry, I'm not good at Ruby and I wasn't able to test a patch for Yamazaki implementing comparison between torrents.
The lack of comparison was problematic, as Ruby was thinking equal Torrents (for us!) were different, making it think Yamazaki got new torrents
(and spamming the same torrents, again ;_;).
Based Launchy. With this commit, Miyuki can recognize if she's running on mac, linux or whatever and give you the right notifier.
Notifier#getNotifier and Notifier#OS are now static methods (and makes sense!)
@RoxasShadow RoxasShadow merged commit cbb7eb0 into RoxasShadow:notifications Dec 6, 2014
@RoxasShadow
Copy link
Owner

First of all, thanks for your PR. Secondly, check the indentation of your editor, because it sucks, and have a deep look at ruby coding guidelines.

Anyway, I removed for now the sound parameter and the support to older configurations. At the first one we'll work later, while the latter no one cares about the old configuration.
Also, I put the adapters in their own folders and implemented a callback that is executed as soon as a torrent is downloaded by Yamazaki.

Thanks again for your contribuitions on this project. I hope to see soon your face here (but remember that Miyuki is only mine :D)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants