Commit Graph

22 Commits

Author SHA1 Message Date
Thomas 6f3759a928 Use script.module.libtorrent to import libtorrent
In order to support more systems (especially the ones where the
libtorrent python bindings cannot be installed manually), the add-on
script.module.libtorrent is now used to import libtorrent.
2021-05-19 17:18:00 +00:00
Thomas 134d2ea974 Localize and translate into French the add-on
* Localize all the strings so that the whole add-on can be translated
  (menus, notifications, etc.)
* Translate all the strings into French
* Add advice for future translators in the contribution guidelines
* List the supported languages in the README and a link to the
  translation guidelines
* Rearrange the parts of the README to have the most used information at
  the top
2021-04-29 20:38:14 +00:00
Thomas cb1825c1f9 Notify the user when the service started
Display a notification when the PeerTube service started so that the
user is aware that the add-on can be used.
This notification will be useful especially on slow devices.

The notification can be disabled in the settings.
2021-04-28 21:02:24 +00:00
Thomas 7a1a4e8485 Redesign the main file of the add-on
New features:
* Add the description of each video and each instance. The total number
  of local videos and users of an instance are also added to the
  description of the instance in Kodi.
* Add the total number of pages in the "Next page" item (+ fix the
  number of the current page)
* Display a notification when the download of the torrent starts (will
  help the user to know that something is going on, especially on slow
  machines)
* Support instance URL that are prefixed with "https://" in the settings

Internal changes:
* Create a smaller entry point file to match Kodi's best practices
  (main.py)
* Create a new main module (addon.py) containing only the code related
  to the add-on execution. The other lines of code were moved to the
  classes PeerTube or KodiUtils.
* KodiUtils is now a class and an instance of this class is made
  available to all the modules of the add-on to reuse easily its methods
  and attributes.
* Create helper functions in KodiUtils for creating items in Kodi UI
  easily

See merge request StCyr/plugin.video.peertube!17 for more information
2021-04-22 20:48:20 +00:00
Thomas 6f94e05398 Replace single quotes with double quotes
Make this a coding rule so that apostrophes don't need to be escaped in
strings (they are common in English and other languages).
2021-04-19 13:20:47 +00:00
Thomas 0efeb9ffdf Support videos when WebTorrent is disabled
The URL of the video is not stored in the same attribute of the response
if WebTorrent is enabled or not.
It caused a bug when trying to play a video which do not use WebTorrent.

Also create a "quality" job to run pylint automatically on merge
requests. The contributing guidelines are updated with this information
and the remaining pylint violations were fixed in the code.

See merge request StCyr/plugin.video.peertube!11 for more information
2021-04-11 21:51:35 +00:00
Thomas 4346178db9 Guide the user when libtorrent cannot be imported
Libtorrent is required to play videos but its installation is still
manual so now a message is displayed when libtorrent could not be
imported instead of having a "service could not start" error at Kodi
startup.
The message contains a link to a page which explains how to install
libtorrent. It will be displayed when:
* the add-on starts
* the user selects a video to play (including when called externally)

Other additions:
* Create a kodi_utils module to centralize some calls to the Kodi API
* Add license information in the header of the files
* Ignore some files in Git (python cache and Mac OS system file)
2021-04-08 23:25:49 +02:00
Famille Bollu 0d63448e8f Fixed a bug in PeertubeDownloader.run() where I was refering to variable 'torrent'
instead of 'self.torrent'
2018-07-27 17:37:48 +02:00
Cyrille Bollu 143e066fbc Changed logging level to LOGDEBUG as requested by https://kodi.wiki/view/Add-on_rules 2018-07-27 11:26:40 +02:00
Cyrille Bollu 3cbf940e82 Updated code to use torrent files rather than magnets (For some reason magnet files
provided by peerTube don't work) + refactored code related to the management of the
addon's temporary directory
2018-07-27 10:55:50 +02:00
Famille Bollu 914bcb9234 Added logging 2018-07-27 07:40:45 +02:00
Famille Bollu 8110fa2b7d Fixed a typo to get the state of a torrent'status 2018-07-26 22:34:26 +02:00
Famille Bollu f2dd0e0a3a forgot a "self" argument to the peertubeService's init function 2018-07-26 22:23:31 +02:00
Famille Bollu c9d9b9e868 fixed a typo in call to torrent_handle.status() 2018-07-26 22:22:07 +02:00
Famille Bollu 55aa736e97 Fixed the PeertubeService's init function + added code to create our temporary directory 2018-07-26 22:20:43 +02:00
Famille Bollu d38abc0bf6 Fixed a typo and an error in PeertubeDownloader's init function 2018-07-26 21:59:05 +02:00
Famille Bollu 4729397b16 in classes, callback functions should be specified self.callbackfunction and not just
callbackfunction
2018-07-26 21:37:08 +02:00
Famille Bollu 9b79c9dfa1 Cleaned import stanzas 2018-07-26 20:03:32 +02:00
Famille Bollu 1f1132f4fc Refactored code to let the downloader thread be started by the service 2018-07-26 19:59:47 +02:00
Famille Bollu 9b140a77d3 Revert "Will use a downloader thread directly from peertube.py. Will not use a service anymore."
This reverts commit 5f590f48cd.

In the end, a service is needed: The addon is ended when kodi starts playing the file, so the
downloader thread would be ended also. I need to launch the downloader thread from something that
isn't expected to end, which is why services exist.
2018-07-26 19:32:37 +02:00
Cyrille Bollu 5f590f48cd Will use a downloader thread directly from peertube.py. Will not use a service anymore. 2018-07-26 17:41:08 +02:00
Cyrille Bollu c9a0d5df8c Created a first service skeleton to download torrent in the background 2018-07-26 11:52:04 +02:00