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

Feature/vueify home #5345

Merged
merged 103 commits into from
May 21, 2020
Merged
Show file tree
Hide file tree
Changes from 93 commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
c77a3e4
first run at banner
OmgImAlexis Sep 29, 2018
6199e49
fix column sorter
OmgImAlexis Sep 29, 2018
07e0b44
remap stats into showList
OmgImAlexis Sep 29, 2018
d8e8bbc
fix show size being undefined
OmgImAlexis Sep 29, 2018
a2cce69
replaced downloadStats with progress bar component
OmgImAlexis Sep 29, 2018
439891a
removed jQuery from progress-bar, moved banner to own file and starte…
OmgImAlexis Oct 1, 2018
9c6e0a0
load banner directly in home layout
OmgImAlexis Oct 2, 2018
be6b1cd
fix allowed & preferred qualities
OmgImAlexis Oct 2, 2018
e8700bd
switch simple home layout to vue
OmgImAlexis Oct 2, 2018
70b3e3b
fix series listType with tabs
OmgImAlexis Oct 2, 2018
b28ab61
skip mako when rendering vue layouts
OmgImAlexis Oct 2, 2018
7e6839d
Merge remote-tracking branch 'origin/develop' into feature/vueify-home
OmgImAlexis Oct 15, 2018
1df983f
Merge remote-tracking branch 'remotes/origin/develop' into feature/vu…
p0psicles Nov 2, 2018
8b944d8
Tried fixing the build.
p0psicles Nov 2, 2018
b7b91ca
fix imports/exports
OmgImAlexis Nov 2, 2018
cf4005a
Merge remote-tracking branch 'remotes/origin/develop' into feature/vu…
p0psicles Nov 4, 2018
00023be
Merge remote-tracking branch 'origin/develop' into feature/vueify-home
p0psicles Nov 29, 2019
bdae975
Fixed some issues caused by conflicts.
p0psicles Nov 30, 2019
1a122b1
Moved from home.mako to SFC home.vue.
p0psicles Dec 3, 2019
51b4638
Added basic (minimal) vue-good-table to simple.vue.
p0psicles Dec 3, 2019
5310aa8
Add fields to vue-good-table.
p0psicles Dec 4, 2019
75f12c7
Merge branch 'develop' into feature/vueify-home
p0psicles Apr 15, 2020
2d447bb
Calculate local time in apiv2 stats.
p0psicles Apr 16, 2020
5f0295e
Add prev_airdate to series.py
p0psicles Apr 16, 2020
60ccb39
Moved the date formatting to store/modules/layout.js
p0psicles Apr 16, 2020
7c5d388
Add banner.vue
p0psicles Apr 17, 2020
cf104a4
Attempt at trying to add small.vue.
p0psicles Apr 17, 2020
2398b7e
For some weird reason <component> does not accept "small" for the :is…
p0psicles Apr 17, 2020
5eba557
Started vueifying home/poster.vue
p0psicles Apr 18, 2020
6383a6f
Home poster layout:
p0psicles Apr 19, 2020
5393214
Sorting asc/desc order.
p0psicles Apr 19, 2020
6186d47
Fix filtering by text
p0psicles Apr 20, 2020
7586b00
Remove reload of page.
p0psicles Apr 20, 2020
cf002bb
Fixed link to displayShow
p0psicles Apr 20, 2020
7a6a6cc
Typo. (ready for some testing)
p0psicles Apr 20, 2020
ebeae21
Merge remote-tracking branch 'remotes/origin/develop' into feature/vu…
p0psicles Apr 20, 2020
8c1b5b9
yarn dev
p0psicles Apr 20, 2020
ac91cd7
Fix showStats if show does not have any episodes.
p0psicles Apr 20, 2020
0d410fd
Fixed issue with merging showStats
p0psicles Apr 20, 2020
86abaf2
Fix updating vue-isotope when sliding the size slide bar.
p0psicles Apr 20, 2020
59f9320
Fixed scaling images with slidebar.
p0psicles Apr 21, 2020
d1492ea
Added Action "ADD_SHOWS" to load shows in bulk.
p0psicles Apr 22, 2020
dd3f155
Added mutation ADD_SHOWS to mutation-types.js
p0psicles Apr 22, 2020
921e70e
Fixed loading poster size.
p0psicles Apr 22, 2020
ca6c1a3
Move the loading of the shows to app.js.
p0psicles Apr 22, 2020
450e906
Use v-model in stead.
p0psicles Apr 22, 2020
0c55c52
Merge remote-tracking branch 'remotes/origin/develop' into feature/vu…
p0psicles Apr 22, 2020
fdeb3e8
Fix poster sort UI components.
p0psicles Apr 22, 2020
124e3bc
Fix home layout for split shows into Anime / Series.
p0psicles Apr 23, 2020
079a815
Re-enable dragging of the show list-types.
p0psicles Apr 24, 2020
d195c1b
Fix display-show.vue and show-header.vue css styling.
p0psicles Apr 25, 2020
dc6e36c
Fix styling for the home table layouts.
p0psicles Apr 25, 2020
30bb552
Add column filters to simple.vue layout.
p0psicles Apr 25, 2020
817a1d1
Only provide key for getting cookies.
p0psicles Apr 25, 2020
d8a73f4
Shorten preset, to make it more uniform.
p0psicles Apr 25, 2020
7b0b63e
Fix light/dark themes
p0psicles Apr 25, 2020
472acbb
Add backstretch component with random image to home
p0psicles Apr 25, 2020
b3c6598
Move selectedRootIndex config property to layout route.
p0psicles Apr 25, 2020
ca5543c
rearange home and poster UI controls.
p0psicles Apr 26, 2020
b0d67f0
yarn dev
p0psicles Apr 26, 2020
c6d9d39
Improve prev_episode / next_episode calculating.
p0psicles Apr 28, 2020
f601934
Improve formatting
p0psicles Apr 28, 2020
b65e072
Improve calculating columns Active and Xem.
p0psicles Apr 28, 2020
0772892
Fix the table layouts, sorting.
p0psicles May 1, 2020
168910f
Fix duplicate loading of shows.js
p0psicles May 2, 2020
28bec4e
Improved dark/light css styling
p0psicles May 2, 2020
0381d2d
Replace styling the summaryBackground banner and the checkboxControls…
p0psicles May 3, 2020
41655d7
Fix vgt-tabs styling
p0psicles May 3, 2020
7a5e0e6
Add date or status to poster layout.
p0psicles May 3, 2020
00ce71b
Fix poster layout sorting.
p0psicles May 11, 2020
b32a9a1
Fix test_config tests.
p0psicles May 12, 2020
75b1087
eslint and css-lint cleanup.
p0psicles May 12, 2020
b7cdc8a
Merge remote-tracking branch 'remotes/origin/develop' into feature/vu…
p0psicles May 12, 2020
5f4ac20
Bump vue-good-table version
p0psicles May 12, 2020
c3d60d7
Added new npm packages:
p0psicles May 12, 2020
b71514f
Increase width between indexer images.
p0psicles May 12, 2020
02d225d
Fix missing class tvShow.
p0psicles May 12, 2020
8b6c729
Dark styling on the vue-nav-tabs and vue-good-table
p0psicles May 13, 2020
d4c7198
Fixed arrange posters on tab change.
p0psicles May 13, 2020
be2139a
Move poster size slider jquery to lock in component.
p0psicles May 13, 2020
9dfbd41
Fixing pytest
p0psicles May 14, 2020
0e912f1
Fix pytest
p0psicles May 14, 2020
588a699
Fix lint and lint-css errors.
p0psicles May 14, 2020
f25ec0a
Fixed test_config layout test.
p0psicles May 14, 2020
a2ecb9d
recreate yarn.lock
p0psicles May 14, 2020
c40032b
yarn cache clean && yarn dev
medariox May 14, 2020
16a3156
Fix some of the css-lint errors.
p0psicles May 15, 2020
e16f6fc
Use testing-library/jest-dom to replace deprecated isVisible()
p0psicles May 15, 2020
c180ed6
Update snapshots
p0psicles May 15, 2020
42bd349
Added test for lazy loading in asset.spec.js
p0psicles May 15, 2020
7874e99
Fix pep8 warnings
p0psicles May 15, 2020
6995389
Fix error in pytest running on py2.
p0psicles May 15, 2020
201a028
rebundle
p0psicles May 15, 2020
aa476a1
Improve show loading.
p0psicles May 16, 2020
0ea928e
Fix bug non-vue routes not loading anymore.
p0psicles May 17, 2020
2d5c9c8
Move shared vue code for the show-list table layouts, to a dedicated …
p0psicles May 18, 2020
2ef2fa2
import error
p0psicles May 18, 2020
809ca27
Improve date sorting for small, simple and banner.
p0psicles May 19, 2020
677572a
implemented review comments
p0psicles May 19, 2020
f472313
Save column sorting for simple.vue, smallposter.vue and banner.vue la…
p0psicles May 19, 2020
050c946
Fix getBoundClientRect error.
p0psicles May 20, 2020
7f48885
Fix storing he pagination per page count.
p0psicles May 20, 2020
6a36b26
Make sure the load-progress-bar is full width on smaller devices.
p0psicles May 20, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions medusa/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2134,6 +2134,7 @@ def load_shows_from_db():
for sql_show in sql_results:
try:
cur_show = Series(sql_show['indexer'], sql_show['indexer_id'])
cur_show.prev_episode()
cur_show.next_episode()
app.showList.append(cur_show)
except Exception as error:
Expand Down
10 changes: 5 additions & 5 deletions medusa/server/api/v2/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ class ConfigHandler(BaseRequestHandler):
#: patch mapping
patches = {
# Main
'selectedRootIndex': IntegerField(app, 'SELECTED_ROOT'),
'rootDirs': ListField(app, 'ROOT_DIRS'),

'showDefaults.status': EnumField(app, 'STATUS_DEFAULT', (SKIPPED, WANTED, IGNORED), int),
Expand Down Expand Up @@ -474,6 +473,7 @@ class ConfigHandler(BaseRequestHandler):
'layout.backlogOverview.status': StringField(app, 'BACKLOG_STATUS'),
'layout.timeStyle': StringField(app, 'TIME_PRESET_W_SECONDS'),
'layout.dateStyle': StringField(app, 'DATE_PRESET'),
'layout.selectedRootIndex': IntegerField(app, 'SELECTED_ROOT'),
}

def get(self, identifier, path_param=None):
Expand Down Expand Up @@ -615,8 +615,6 @@ def data_main():
section_data['logs']['subliminalLog'] = bool(app.SUBLIMINAL_LOG)
section_data['logs']['privacyLevel'] = app.PRIVACY_LEVEL

section_data['selectedRootIndex'] = int_default(app.SELECTED_ROOT, -1) # All paths

# Added for config - main, needs refactoring in the structure.
section_data['launchBrowser'] = bool(app.LAUNCH_BROWSER)
section_data['defaultPage'] = app.DEFAULT_PAGE
Expand Down Expand Up @@ -1174,7 +1172,7 @@ def data_layout():

section_data['wide'] = bool(app.LAYOUT_WIDE)

section_data['posterSortdir'] = int(app.POSTER_SORTDIR)
section_data['posterSortdir'] = int(app.POSTER_SORTDIR or 0)
section_data['themeName'] = app.THEME_NAME
section_data['animeSplitHomeInTabs'] = bool(app.ANIME_SPLIT_HOME_IN_TABS)
section_data['animeSplitHome'] = bool(app.ANIME_SPLIT_HOME)
Expand All @@ -1192,11 +1190,13 @@ def data_layout():
section_data['comingEps'] = {}
section_data['comingEps']['displayPaused'] = bool(app.COMING_EPS_DISPLAY_PAUSED)
section_data['comingEps']['sort'] = app.COMING_EPS_SORT
section_data['comingEps']['missedRange'] = int(app.COMING_EPS_MISSED_RANGE)
section_data['comingEps']['missedRange'] = int(app.COMING_EPS_MISSED_RANGE or 0)
section_data['comingEps']['layout'] = app.COMING_EPS_LAYOUT

section_data['backlogOverview'] = {}
section_data['backlogOverview']['status'] = app.BACKLOG_STATUS
section_data['backlogOverview']['period'] = app.BACKLOG_PERIOD

section_data['selectedRootIndex'] = int_default(app.SELECTED_ROOT, -1) # All paths

return section_data
42 changes: 25 additions & 17 deletions medusa/server/api/v2/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
UNAIRED,
WANTED
)
from medusa.network_timezones import parse_date_time
from medusa.server.api.v2.base import BaseRequestHandler
from medusa.show.show import Show

Expand Down Expand Up @@ -66,46 +67,49 @@ def query_in(items):
return '({0})'.format(','.join(map(str, items)))

query = dedent("""\
SELECT indexer AS indexerId, showid AS seriesId,
SELECT tv_eps.indexer AS indexerId, tv_eps.showid AS seriesId,
SUM(
season > 0 AND
episode > 0 AND
airdate > 1 AND
status IN {status_quality}
tv_eps.status IN {status_quality}
) AS epSnatched,
SUM(
season > 0 AND
episode > 0 AND
airdate > 1 AND
status IN {status_download}
tv_eps.status IN {status_download}
) AS epDownloaded,
SUM(
season > 0 AND
episode > 0 AND
airdate > 1 AND (
(airdate <= {today} AND status IN {status_pre_today}) OR
status IN {status_both}
(airdate <= {today} AND tv_eps.status IN {status_pre_today}) OR
tv_eps.status IN (2,9,12,4,6)
p0psicles marked this conversation as resolved.
Show resolved Hide resolved
)
) AS epTotal,
(SELECT airdate FROM tv_episodes
WHERE showid=tv_eps.showid AND
indexer=tv_eps.indexer AND
WHERE tv_episodes.showid=tv_eps.showid AND
tv_episodes.indexer=tv_eps.indexer AND
airdate >= {today} AND
(status = {unaired} OR status = {wanted})
(tv_eps.status = {unaired} OR tv_eps.status = {wanted})
ORDER BY airdate ASC
LIMIT 1
) AS epAirsNext,
(SELECT airdate FROM tv_episodes
WHERE showid=tv_eps.showid AND
indexer=tv_eps.indexer AND
airdate > 1 AND
status <> {unaired}
WHERE tv_episodes.showid=tv_eps.showid AND
tv_episodes.indexer=tv_eps.indexer AND
airdate > {today} AND
tv_eps.status <> {unaired}
ORDER BY airdate DESC
LIMIT 1
) AS epAirsPrev,
SUM(file_size) AS seriesSize
FROM tv_episodes tv_eps
GROUP BY showid, indexer
SUM(file_size) AS seriesSize,
tv_shows.airs as airs,
tv_shows.network as network
FROM tv_episodes tv_eps, tv_shows
WHERE tv_eps.showid = tv_shows.indexer_id AND tv_eps.indexer = tv_shows.indexer
GROUP BY tv_eps.showid, tv_eps.indexer;
""").format(
status_quality=query_in(snatched),
status_download=query_in(downloaded),
Expand All @@ -121,12 +125,16 @@ def query_in(items):
sql_result = main_db_con.select(query)

stats_data = {}
stats_data['seriesStat'] = []
stats_data['stats'] = []
stats_data['maxDownloadCount'] = 1000
for cur_result in sql_result:
stats_data['seriesStat'].append(cur_result)
stats_data['stats'].append(cur_result)
if cur_result['epTotal'] > stats_data['maxDownloadCount']:
stats_data['maxDownloadCount'] = cur_result['epTotal']
if cur_result['epAirsNext']:
cur_result['epAirsNext'] = parse_date_time(cur_result['epAirsNext'], cur_result['airs'], cur_result['network'])
if cur_result['epAirsPrev']:
cur_result['epAirsPrev'] = parse_date_time(cur_result['epAirsPrev'], cur_result['airs'], cur_result['network'])

stats_data['maxDownloadCount'] *= 100
return stats_data
82 changes: 48 additions & 34 deletions medusa/server/web/home/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,41 +121,55 @@ def _genericMessage(self, subject, message):
return t.render(message=message, subject=subject, title='')

def index(self):
t = PageTemplate(rh=self, filename='home.mako')
selected_root = int(app.SELECTED_ROOT)
shows_dir = None
if selected_root is not None and app.ROOT_DIRS:
backend_pieces = app.ROOT_DIRS
backend_dirs = backend_pieces[1:]
try:
shows_dir = backend_dirs[selected_root] if selected_root != -1 else None
except IndexError:
# If user have a root selected in /home and remove the root folder a IndexError is raised
shows_dir = None
app.SELECTED_ROOT = -1

series = []
if app.ANIME_SPLIT_HOME:
anime = []
for show in app.showList:
if shows_dir and not show._location.startswith(shows_dir):
continue
if show.is_anime:
anime.append(show)
else:
series.append(show)

show_lists = [[order, {'Series': series, 'Anime': anime}[order]] for order in app.SHOW_LIST_ORDER]
else:
for show in app.showList:
if shows_dir and not show._location.startswith(shows_dir):
continue
series.append(show)
show_lists = [['Series', series]]
"""
Render the home page.

stats = self.show_statistics()
return t.render(show_lists=show_lists, show_stat=stats[0],
max_download_count=stats[1], controller='home', action='index')
[Converted to VueRouter]
"""
t = PageTemplate(rh=self, filename='index.mako')
return t.render()
# t = PageTemplate(rh=self, filename='home.mako')
# selected_root = int(app.SELECTED_ROOT)
# shows_dir = None
# if selected_root is not None and app.ROOT_DIRS:
# backend_pieces = app.ROOT_DIRS
# backend_dirs = backend_pieces[1:]
# try:
# shows_dir = backend_dirs[selected_root] if selected_root != -1 else None
# except IndexError:
# # If user have a root selected in /home and remove the root folder a IndexError is raised
# shows_dir = None
# app.SELECTED_ROOT = -1
#
# if not app.HOME_LAYOUT in ['simple', 'banner']:
# series = []
# if app.ANIME_SPLIT_HOME:
# anime = []
# for show in app.showList:
# if shows_dir and not show._location.startswith(shows_dir):
# continue
# if show.is_anime:
# anime.append(show)
# else:
# series.append(show)
#
# show_lists = [[order, {'Series': series, 'Anime': anime}[order]] for order in app.SHOW_LIST_ORDER]
# else:
# for show in app.showList:
# if shows_dir and not show._location.startswith(shows_dir):
# continue
# series.append(show)
# show_lists = [['Series', series]]
#
# all_stats = self.show_statistics()
# stats = all_stats[0]
# max_download_count = all_stats[1]
# else:
# show_lists = []
# stats = []
# max_download_count = 0
# return t.render(show_lists=show_lists, show_stat=stats,
# max_download_count=max_download_count, controller='home', action='index')
p0psicles marked this conversation as resolved.
Show resolved Hide resolved

@staticmethod
def show_statistics():
Expand Down
62 changes: 57 additions & 5 deletions medusa/tv/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ def __init__(self, indexer, indexerid, lang='', quality=None,
self.default_ep_status = SKIPPED
self._location = ''
self.episodes = {}
self.prev_aired = ''
self.next_aired = ''
self.release_groups = None
self.exceptions = set()
Expand Down Expand Up @@ -555,9 +556,17 @@ def last_update_indexer(self):
epoch_date = update_date - datetime.date.fromtimestamp(0)
return int(epoch_date.total_seconds())

@property
def prev_airdate(self):
"""Return last aired episode airdate."""
return (
sbdatetime.convert_to_setting(network_timezones.parse_date_time(self.prev_aired, self.airs, self.network))
if try_int(self.prev_aired, 1) > MILLIS_YEAR_1900 else None
)

@property
def next_airdate(self):
"""Return next airdate."""
"""Return next aired episode airdate."""
return (
sbdatetime.convert_to_setting(network_timezones.parse_date_time(self.next_aired, self.airs, self.network))
if try_int(self.next_aired, 1) > MILLIS_YEAR_1900 else None
Expand Down Expand Up @@ -623,7 +632,7 @@ def aliases_to_json(self):
@property
def xem_numbering(self):
"""Return series episode xem numbering."""
return get_xem_numbering_for_show(self)
return get_xem_numbering_for_show(self, False)
p0psicles marked this conversation as resolved.
Show resolved Hide resolved

@property
def xem_absolute_numbering(self):
Expand Down Expand Up @@ -1612,6 +1621,47 @@ def load_imdb_info(self):
log.debug(u'{id}: Obtained info from IMDb: {imdb_info}',
{'id': self.series_id, 'imdb_info': self.imdb_info})

def prev_episode(self):
"""Return the last aired episode air date.

:return:
:rtype: datetime.date
"""
log.debug(u'{id}: Finding the episode which aired last',
p0psicles marked this conversation as resolved.
Show resolved Hide resolved
{'id': self.series_id})

main_db_con = db.DBConnection()
sql_results = main_db_con.select(
'SELECT '
' airdate,'
' season,'
' episode '
'FROM '
' tv_episodes '
'WHERE '
' indexer = ?'
' AND showid = ? '
' AND airdate < ? '
' AND status <> ? '
'ORDER BY'
' airdate '
'DESC LIMIT 1',
[self.indexer, self.series_id, datetime.date.today().toordinal(), UNAIRED])

if sql_results is None or len(sql_results) == 0:
log.debug(u'{id}: No episode found... need to implement a show status', {'id': self.series_id})
p0psicles marked this conversation as resolved.
Show resolved Hide resolved
self.prev_aired = u''
else:
log.debug(
u'{id}: Found episode {ep}', {
p0psicles marked this conversation as resolved.
Show resolved Hide resolved
'id': self.series_id,
'ep': episode_num(sql_results[0]['season'], sql_results[0]['episode'])
}
)
self.prev_aired = sql_results[0]['airdate']

return self.prev_aired

def next_episode(self):
"""Return the next episode air date.

Expand All @@ -1635,11 +1685,10 @@ def next_episode(self):
' indexer = ?'
' AND showid = ? '
' AND airdate >= ? '
' AND status IN (?,?) '
'ORDER BY'
' airdate '
'ASC LIMIT 1',
[self.indexer, self.series_id, datetime.date.today().toordinal(), UNAIRED, WANTED])
[self.indexer, self.series_id, datetime.date.today().toordinal()])

if sql_results is None or len(sql_results) == 0:
log.debug(u'{id}: No episode found... need to implement a show status',
Expand Down Expand Up @@ -2056,6 +2105,7 @@ def to_json(self, detailed=False, episodes=False):
data['imdbInfo'] = {to_camel_case(k): v for k, v in viewitems(self.imdb_info)}
data['year'] = {}
data['year']['start'] = self.imdb_year or self.start_year
data['prevAirDate'] = self.prev_airdate.isoformat() if self.prev_airdate else None
data['nextAirDate'] = self.next_airdate.isoformat() if self.next_airdate else None
data['lastUpdate'] = datetime.date.fromordinal(self._last_update_indexer).isoformat()
data['runtime'] = self.imdb_runtime or self.runtime
Expand Down Expand Up @@ -2097,6 +2147,9 @@ def to_json(self, detailed=False, episodes=False):
data['config']['release']['requiredWordsExclude'] = bool(self.rls_require_exclude)
data['config']['airdateOffset'] = self.airdate_offset

# Moved from detailed, as the home page, needs it to display the Xem icon.
data['xemNumbering'] = numbering_tuple_to_dict(self.xem_numbering)

# These are for now considered anime-only options
if self.is_anime:
bw_list = self.release_groups or BlackAndWhiteList(self)
Expand All @@ -2112,7 +2165,6 @@ def to_json(self, detailed=False, episodes=False):
if detailed:
data['size'] = self.size
data['showQueueStatus'] = self.show_queue_status
data['xemNumbering'] = numbering_tuple_to_dict(self.xem_numbering)
data['sceneAbsoluteNumbering'] = dict_to_array(self.scene_absolute_numbering, key='absolute', value='sceneAbsolute')
if self.is_scene:
data['xemAbsoluteNumbering'] = dict_to_array(self.xem_absolute_numbering, key='absolute', value='sceneAbsolute')
Expand Down
14 changes: 14 additions & 0 deletions tests/apiv2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
# coding=utf-8
"""Api v2 tests."""
from __future__ import unicode_literals

import os
import sys

import six

# Start event loop in python3
if six.PY3:
import asyncio

# We need to set the WindowsSelectorEventLoop event loop on python 3 (3.8 and higher) running on windows
if sys.platform == 'win32':
try:
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
except AttributeError: # Only available since Python 3.7.0
pass

sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), '../../lib')))
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), '../../ext')))
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), '../..')))
Loading