Skip to content

Commit

Permalink
Make Nextcloud version comparison with int instead of string. (#45)
Browse files Browse the repository at this point in the history
* Make Nextcloud version comparison with int instead of string.
  • Loading branch information
mwalbeck committed Mar 23, 2022
1 parent 0ff3dfe commit 4f8ac63
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ geckodriver.log
/config.json
/config.toml
/dist
/.mypy_cache
9 changes: 4 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
"python.linting.mypyEnabled": false,
"python.linting.mypyPath": ".venv/bin/mypy",
"python.testing.pytestPath": ".venv/bin/pytest",
"python.linting.pylintEnabled": false,
"python.linting.pylintPath": ".venv/bin/pylint",
"python.linting.banditPath": ".venv/bin/bandit",
"python.formatting.provider": "black",
"python.analysis.typeCheckingMode": "off",
"python.analysis.extraPaths": [
"./talked"
],
"python.analysis.extraPaths": ["./talked"],
"[python]": {
"editor.codeActionsOnSave": {"source.organizeImports": true},
"editor.codeActionsOnSave": { "source.organizeImports": true }
},
"autoDocstring.startOnNewLine": true,
"autoDocstring.startOnNewLine": true
}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## [Unreleased]

## 0.3.2 - 2022-03-23

### Fixed

- Make Nextcloud version comparison with int instead of string.

## 0.3.1 - 2022-01-11

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "talked"
version = "0.3.1"
version = "0.3.2"
description = "Call recording for Nextcloud Talk"
authors = ["Magnus Walbeck <[email protected]>"]
license = "AGPL-3.0-or-later"
Expand Down
2 changes: 1 addition & 1 deletion talked/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from tomlkit import parse

__version__ = "0.3.1"
__version__ = "0.3.2"

LOG_LEVELS = {
"critical": logging.CRITICAL,
Expand Down
12 changes: 6 additions & 6 deletions talked/recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def start(
token: str,
queue: Queue,
recording: Event,
nextcloud_version: str,
nextcloud_version: int,
audio_only: bool,
grid_view: bool,
) -> None:
Expand Down Expand Up @@ -109,7 +109,7 @@ def start(


def launch_browser(
call_link: str, msg_queue: Queue, nextcloud_version: str, grid_view: bool
call_link: str, msg_queue: Queue, nextcloud_version: int, grid_view: bool
) -> WebDriver:
logging.info("Configuring browser options")
options = Options()
Expand Down Expand Up @@ -201,7 +201,7 @@ def change_name_of_user(driver: WebDriver) -> None:
)


def join_call(driver: WebDriver, msg_queue: Queue, nextcloud_version: str) -> None:
def join_call(driver: WebDriver, msg_queue: Queue, nextcloud_version: int) -> None:
# Wait for the green Join Call button to appear then click it
logging.info("Waiting for join call button to appear")
try:
Expand All @@ -223,7 +223,7 @@ def join_call(driver: WebDriver, msg_queue: Queue, nextcloud_version: str) -> No
logging.info("Joining call")
join_call_button.click()

if nextcloud_version == "23":
if nextcloud_version == 23:
logging.info("Handling device checker screen")
try:
device_checker_join_call_button = WebDriverWait(driver, 10).until(
Expand Down Expand Up @@ -267,11 +267,11 @@ def mute_user(driver: WebDriver) -> None:
logging.info(("Mute button wasn't found. Assuming we are already muted."))


def switch_to_speaker_view(driver: WebDriver, nextcloud_version: str) -> None:
def switch_to_speaker_view(driver: WebDriver, nextcloud_version: int) -> None:
# Switch to speaker view
logging.info("Switching to speaker view")

if nextcloud_version == "23":
if nextcloud_version == 23:
driver.find_element_by_css_selector(
".local-media-controls button.action-item__menutoggle"
).click()
Expand Down

0 comments on commit 4f8ac63

Please sign in to comment.