Skip to content

Commit

Permalink
Merge pull request #929 from MoojMidge/master
Browse files Browse the repository at this point in the history
v7.1.1+beta.1
  • Loading branch information
MoojMidge authored Oct 10, 2024
2 parents 74c4ced + 2097537 commit bcb9046
Show file tree
Hide file tree
Showing 32 changed files with 939 additions and 674 deletions.
2 changes: 1 addition & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.youtube" name="YouTube" version="7.1.0.1" provider-name="anxdpanic, bromix, MoojMidge">
<addon id="plugin.video.youtube" name="YouTube" version="7.1.1+beta.1" provider-name="anxdpanic, bromix, MoojMidge">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
<import addon="script.module.requests" version="2.27.1"/>
Expand Down
23 changes: 23 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
## v7.1.1+beta.1
### Fixed
- Fix http server not listening on any interface if listen IP is 0.0.0.0 #927

### New
- Explicitly enable TCP keep alive #913
- Add localised title and description for videos, channels and playlists
- Update display of playlists to show the following details:
- item count
- date
- channel name
- description
- web url
- podcast status
- Update display of channels to show the following details:
- view count
- subscriber count
- video count
- date
- description
- channel name in description
- web url

## v7.1.0.1
### Fixed
- Fix logging/retry of sqlite3.OperationalError
Expand Down
14 changes: 9 additions & 5 deletions resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -1254,15 +1254,15 @@ msgid "Shorts (1 minute or less)"
msgstr ""

msgctxt "#30737"
msgid ""
msgid "Episodes"
msgstr ""

msgctxt "#30738"
msgid ""
msgid "Videos"
msgstr ""

msgctxt "#30739"
msgid ""
msgid "Subscribers"
msgstr ""

msgctxt "#30740"
Expand Down Expand Up @@ -1482,11 +1482,11 @@ msgid "Views count display colour"
msgstr ""

msgctxt "#30794"
msgid "Likes count display colour"
msgid "Subscriber/Likes count display colour"
msgstr ""

msgctxt "#30795"
msgid "Comments count display colour"
msgid "Videos/Comments count display colour"
msgstr ""

msgctxt "#30796"
Expand Down Expand Up @@ -1584,3 +1584,7 @@ msgstr ""
msgctxt "#30819"
msgid "Play from start"
msgstr ""

msgctxt "#30820"
msgid "Podcast"
msgstr ""
2 changes: 1 addition & 1 deletion resources/lib/youtube_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,5 @@ def reset_access_tokens(addon_id):
return
context = XbmcContext(params={'addon_id': addon_id})
context.get_access_manager().update_access_token(
addon_id, access_token='', refresh_token=''
addon_id, access_token='', expiry=-1, refresh_token=''
)
2 changes: 0 additions & 2 deletions resources/lib/youtube_plugin/kodion/constants/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
PLUGIN_WAKEUP = 'plugin_wakeup'
PLUGIN_SLEEPING = 'plugin_sleeping'
SERVER_WAKEUP = 'server_wakeup'
SERVER_POST_START = 'server_post_start'
WAKEUP = 'wakeup'

# Play options
Expand Down Expand Up @@ -118,7 +117,6 @@
# Sleep/wakeup states
'PLUGIN_SLEEPING',
'PLUGIN_WAKEUP',
'SERVER_POST_START',
'SERVER_WAKEUP',
'WAKEUP',

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
API_SUBMIT = '/youtube/api/submit'
DRM = '/youtube/widevine'
IP = '/youtube/client_ip'
MPD = '/youtube/manifest/dash/'
MPD = '/youtube/manifest/dash'
PING = '/youtube/ping'
REDIRECT = '/youtube/redirect'
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ class XbmcContext(AbstractContext):
'playlist.play.reverse': 30533,
'playlist.play.select': 30535,
'playlist.play.shuffle': 30534,
'playlist.podcast': 30820,
'playlist.progress.updating': 30536,
'playlist.removed_from': 30715,
'playlist.select': 30521,
Expand Down Expand Up @@ -210,7 +211,10 @@ class XbmcContext(AbstractContext):
'sign.multi.title': 30546,
'stats.commentCount': 30732,
# 'stats.favoriteCount': 1036,
'stats.itemCount': 30737,
'stats.likeCount': 30733,
'stats.subscriberCount': 30739,
'stats.videoCount': 30738,
'stats.viewCount': 30767,
'stream.alternate': 30747,
'stream.automatic': 30583,
Expand Down Expand Up @@ -550,7 +554,7 @@ def apply_content(self):
)

def add_sort_method(self, *sort_methods):
args = slice(None if current_system_version.compatible(19, 0) else 2)
args = slice(None if current_system_version.compatible(19) else 2)
for sort_method in sort_methods:
xbmcplugin.addSortMethod(self._plugin_handle, *sort_method[args])

Expand Down
3 changes: 2 additions & 1 deletion resources/lib/youtube_plugin/kodion/items/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from .command_item import CommandItem
from .directory_item import DirectoryItem
from .image_item import ImageItem
from .media_item import AudioItem, VideoItem
from .media_item import AudioItem, MediaItem, VideoItem
from .new_search_item import NewSearchItem
from .next_page_item import NextPageItem
from .search_history_item import SearchHistoryItem
Expand All @@ -38,6 +38,7 @@
'CommandItem',
'DirectoryItem',
'ImageItem',
'MediaItem',
'NewSearchItem',
'NextPageItem',
'SearchHistoryItem',
Expand Down
57 changes: 57 additions & 0 deletions resources/lib/youtube_plugin/kodion/items/base_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ def __init__(self, name, uri, image=None, fanart=None):
self._date = None
self._dateadded = None
self._short_details = None
self._production_code = None

self._cast = None
self._artists = None
self._studios = None

def __str__(self):
return ('------------------------------\n'
Expand Down Expand Up @@ -195,6 +200,58 @@ def get_bookmark_timestamp(self):
def playable(self):
return self._playable

def add_artist(self, artist):
if artist:
if self._artists is None:
self._artists = []
self._artists.append(to_str(artist))

def get_artists(self):
return self._artists

def get_artists_string(self):
if self._artists:
return ', '.join(self._artists)
return None

def set_artists(self, artists):
self._artists = list(artists)

def set_cast(self, members):
self._cast = list(members)

def add_cast(self, name, role=None, order=None, thumbnail=None):
if name:
if self._cast is None:
self._cast = []
self._cast.append({
'name': to_str(name),
'role': to_str(role) if role else '',
'order': int(order) if order else len(self._cast) + 1,
'thumbnail': to_str(thumbnail) if thumbnail else '',
})

def get_cast(self):
return self._cast

def add_studio(self, studio):
if studio:
if self._studios is None:
self._studios = []
self._studios.append(to_str(studio))

def get_studios(self):
return self._studios

def set_studios(self, studios):
self._studios = list(studios)

def set_production_code(self, value):
self._production_code = value or ''

def get_production_code(self):
return self._production_code


class _Encoder(json.JSONEncoder):
def encode(self, obj, nested=False):
Expand Down
83 changes: 21 additions & 62 deletions resources/lib/youtube_plugin/kodion/items/media_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,19 @@ class MediaItem(BaseItem):

_playable = True

def __init__(self, name, uri, image='DefaultFile.png', fanart=None):
def __init__(self,
name,
uri,
image='DefaultFile.png',
fanart=None,
plot=None):
super(MediaItem, self).__init__(name, uri, image, fanart)
self._aired = None
self._premiered = None
self._scheduled_start_utc = None
self._year = None

self._artists = None
self._cast = None
self._genres = None
self._studios = None

self._duration = -1
self._play_count = None
Expand All @@ -44,8 +46,7 @@ def __init__(self, name, uri, image='DefaultFile.png', fanart=None):
self._start_time = None

self._mediatype = None
self._plot = None
self._production_code = None
self._plot = plot
self._rating = None
self._title = self.get_name()
self._track_number = None
Expand Down Expand Up @@ -110,40 +111,6 @@ def set_year_from_datetime(self, date_time):
def get_year(self):
return self._year

def add_artist(self, artist):
if artist:
if self._artists is None:
self._artists = []
self._artists.append(to_str(artist))

def get_artists(self):
return self._artists

def get_artists_string(self):
if self._artists:
return ', '.join(self._artists)
return None

def set_artists(self, artists):
self._artists = list(artists)

def set_cast(self, members):
self._cast = list(members)

def add_cast(self, name, role=None, order=None, thumbnail=None):
if name:
if self._cast is None:
self._cast = []
self._cast.append({
'name': to_str(name),
'role': to_str(role) if role else '',
'order': int(order) if order else len(self._cast) + 1,
'thumbnail': to_str(thumbnail) if thumbnail else '',
})

def get_cast(self):
return self._cast

def add_genre(self, genre):
if genre:
if self._genres is None:
Expand All @@ -156,18 +123,6 @@ def get_genres(self):
def set_genres(self, genres):
self._genres = list(genres)

def add_studio(self, studio):
if studio:
if self._studios is None:
self._studios = []
self._studios.append(to_str(studio))

def get_studios(self):
return self._studios

def set_studios(self, studios):
self._studios = list(studios)

def set_duration(self, hours=0, minutes=0, seconds=0, duration=''):
if duration:
_seconds = duration_to_seconds(duration)
Expand Down Expand Up @@ -232,12 +187,6 @@ def set_plot(self, plot):
def get_plot(self):
return self._plot

def set_production_code(self, value):
self._production_code = value or ''

def get_production_code(self):
return self._production_code

def set_rating(self, rating):
rating = float(rating)
if rating > 10:
Expand Down Expand Up @@ -384,8 +333,13 @@ class AudioItem(MediaItem):
_ALLOWABLE_MEDIATYPES = {CONTENT.AUDIO_TYPE, 'song', 'album', 'artist'}
_DEFAULT_MEDIATYPE = CONTENT.AUDIO_TYPE

def __init__(self, name, uri, image='DefaultAudio.png', fanart=None):
super(AudioItem, self).__init__(name, uri, image, fanart)
def __init__(self,
name,
uri,
image='DefaultAudio.png',
fanart=None,
plot=None):
super(AudioItem, self).__init__(name, uri, image, fanart, plot)
self._album = None

def set_album_name(self, album_name):
Expand All @@ -405,8 +359,13 @@ class VideoItem(MediaItem):
r'(http(s)?://)?www.imdb.(com|de)/title/(?P<imdbid>[t0-9]+)(/)?'
)

def __init__(self, name, uri, image='DefaultVideo.png', fanart=None):
super(VideoItem, self).__init__(name, uri, image, fanart)
def __init__(self,
name,
uri,
image='DefaultVideo.png',
fanart=None,
plot=None):
super(VideoItem, self).__init__(name, uri, image, fanart, plot)
self._directors = None
self._episode = None
self._imdb_id = None
Expand Down
4 changes: 2 additions & 2 deletions resources/lib/youtube_plugin/kodion/items/menu_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ def bookmark_add_channel(context, channel_id, channel_name=''):
return (
(context.localize('bookmark.channel') % (
context.get_ui().bold(channel_name) if channel_name else
context.localize(19029)
context.localize(19029) # "Channel"
)),
context.create_uri(
(PATHS.BOOKMARKS, 'add',),
Expand Down Expand Up @@ -614,7 +614,7 @@ def separator():

def goto_home(context):
return (
context.localize(10000),
context.localize(10000), # "Home"
context.create_uri(
(PATHS.ROUTE, PATHS.HOME,),
{
Expand Down
Loading

0 comments on commit bcb9046

Please sign in to comment.