Commit Graph

8 Commits

Author SHA1 Message Date
Thomas 8dec0f316e Update code for python 3
Drop support of python 2 and make the code compatible with python 3 so that the add-on works on Kodi 19.

Update Kodistubs version in the CI and get rid of the python 2 actions.

Note: script.module.libtorrent is disabled because it will not be used on Matrix (and is not compatible).
It will be replaced by vfs.libtorrent[1] when ready.

[1]: https://framagit.org/thombet/vfs.libtorrent
2021-09-01 22:17:39 +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 Bétous d87f3038d9 Fix an unreachable branch in the search function
The warning notification was never displayed because PeerTube class
always returned a value even if no videos matching the keywords were
found.
2021-04-28 22:49:40 +02:00
Thomas 13186dc697 Improve the settings layout and translation
* Turn the name of the main category of the settings into a localized
  string
* Add separators to group settings per theme
* Make some settings name more explicit
* Translate the possible values of the settings video_filter and
  video_sort_method

See merge request StCyr/plugin.video.peertube!20 for more information
2021-04-27 20:24:24 +00:00
Thomas 4f8af35035 Support live streams
Now the type of a video is defined when trying to play a video so that
live streams (.m3u8) are directly played by Kodi (no download required).

We are able to know if a video is live from the response of the "list"
REST API but it was decided to ignore this information in order to have
a single action to play video (whether it is live or not).
The goal was to keep the API of the add-on as simple as possible so that
externel users only have to call the add-on's API with the ID of a
video, without having to add the type of the video.
The information about the type of the video will anyway be available in
the response used to get the URL of a video so this solution does not
impact the performance.
2021-04-24 14:55:31 +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 074be7aa12 Create a dedicated class to interact with PeerTube
The PeerTube class is responsible for providing methods to call easily
the PeerTube REST APIs.

Other changes:
* the video filter is now also used when searching videos
* in case of error when sending a request, the message from the response
  is displayed on the screen (even when listing the instances)
* all the debug messages are now prefixed with the name of the add-on
  directly in kodi_utils: it allows an easier usage of this function
  anywhere in the add-on
* first version of the design of the add-on added in contributing.md

See merge request StCyr/plugin.video.peertube!14 for more information
2021-04-19 13:04:57 +00:00