Skip to content

Commit

Permalink
Merge branch 'develop' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
PhantomMantis authored Apr 6, 2024
2 parents 72c7dc4 + 7a982e2 commit e648cea
Show file tree
Hide file tree
Showing 11 changed files with 95 additions and 71 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG-beta.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [3.5.1-beta.7](https://github.com/wizarrrr/wizarr/compare/v3.5.1-beta.6...v3.5.1-beta.7) (2023-11-21)


### Bug Fixes

* 🐛 refactor server_api.py and software_lifecycle.py for better exception handling ([8cf2b32](https://github.com/wizarrrr/wizarr/commit/8cf2b329a8aeb4a27b783a454a2a58e02230e294))

## [3.5.1-beta.6](https://github.com/wizarrrr/wizarr/compare/v3.5.1-beta.5...v3.5.1-beta.6) (2023-11-17)


Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,17 @@

# WIZARR NOTICE

We have recently moved Wizarr V2 to its new home at `ghcr.io/wizarrrr/wizarr:v2` if your container was automatically upgraded recently and you received breaking changes, please change your image to `ghcr.io/wizarrrr/wizarr:v2` to resolve this
Wizzar is back in development after the main developer Ash went MIA. Stay tuned for `4.0.0-beta.1` which will be the first release of the new development team. We are working hard to make Wizarr even better than before.

---

Wizarr is a automatic user invitation system for Plex and Jellyfin. Create a unique link and share it to a user and they will be invited to your Media Server after they complete there signup proccess! They can even be guided to download the clients and read instructions on how to use your media software!

## Where is V2?
## What is Wizarr?

Wizarr V2 has moved to the v2 branch [here](https://github.com/Wizarrrr/wizarr/tree/v2), your still more than welcome to use v2 however it will no longer be supported, we recommend using our new version, trust us it's 🔥.
Wizarr is a automatic user invitation system for Plex and Jellyfin. Create a unique link and share it to a user and they will be invited to your Media Server after they complete there signup proccess! They can even be guided to download the clients and read instructions on how to use your media software!

## V3 upgradable from V2?
## What's the difference between V3 and V4?

V3 can now support upgrading from V2, please make a backup of your database.db for the safest upgrade path.
V3 is the current stable version of Wizarr, it is a fully functional system that allows you to invite users to your media server. V4 is the next version of Wizarr that is currently in development (curently the exact same as `3.5.1-beta.7`). There's not much diffrence between the two versions, V4 will involve a refactoring of the codebase and a few new features. V4 will be the first version of Wizarr that is developed by the new development team.

## Major Features Include

Expand Down Expand Up @@ -91,6 +89,8 @@ V3 can now support upgrading from V2, please make a backup of your database.db f

## Getting Started

This version is the exact same as `3.5.1-beta.7` for now but we will be updating the codebase soon. You can install Wizarr by following the instructions below.

```
docker run -d \
--name wizarr \
Expand All @@ -116,7 +116,7 @@ services:

Any issues we welcome you to come onto our [Discord](https://discord.gg/XXCz7aM3ak) and ask for a member of staff, we would be happy to help.

If you want to help contribute to Wizarr by building V3's documentation we would really appreciate it, again join the [Discord](https://discord.gg/XXCz7aM3ak) and we can get you started.
If you want to help contribute to Wizarr by building V4's documentation we would really appreciate it, again join the [Discord](https://discord.gg/XXCz7aM3ak) and we can get you started.

~~Check out our documentation for instructions on how to install and run Wizarr!
[View Documentation](https://github.com/Wizarrrr/wizarr/blob/master/docs/setup/README.md)~~
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def get(self):
"requests": loads(dumps(get_requests(disallowed=["api_key"]), indent=4, sort_keys=True, default=str)),
"version": str(get_current_version()),
"update_available": need_update(),
"debug": True if app.debug else False,
"debug": bool(app.debug),
"setup_required": is_setup_required(),
"is_beta": is_beta(),
"latest_version": str(get_latest_version()),
Expand Down
31 changes: 23 additions & 8 deletions apps/wizarr-backend/wizarr_backend/app/utils/software_lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,35 @@ def get_latest_beta_version():
return None

def get_current_version():
with open(LATEST_FILE, "r", encoding="utf-8") as f:
current_version = str(f.read())
return parse(current_version)
try:
with open(LATEST_FILE, "r", encoding="utf-8") as f:
current_version = str(f.read())
return parse(current_version)
except Exception:
return None

def is_beta():
return search(r"\d\.\d\.\d\w\d", str(get_current_version())) is not None
try:
return search(r"\d\.\d\.\d\w\d", str(get_current_version())) is not None
except Exception:
return False

def is_latest():
if str(get_current_version()) == str(is_beta() and get_latest_beta_version() or get_latest_version()):
try:
if str(get_current_version()) == str(is_beta() and get_latest_beta_version() or get_latest_version()):
return True
return compare_versions(get_current_version(), is_beta() and get_latest_beta_version() or get_latest_version())
except Exception:
return True
return compare_versions(get_current_version(), is_beta() and get_latest_beta_version() or get_latest_version())

def is_stable():
return not is_beta()
try:
return not is_beta()
except Exception:
return True

def need_update():
return not is_latest()
try:
return not is_latest()
except Exception:
return False
6 changes: 4 additions & 2 deletions apps/wizarr-frontend/src/modules/settings/pages/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<template v-for="(section, index) in settingsSections">
<div :id="`settingsContainer${index}`">
<!-- Sections Title -->
<div class="settings-section" v-if="!(sectionDisabled(section) && env.NODE_ENV === 'production')">
<div class="settings-section" v-if="!(sectionDisabled(section) && !is_beta)">
<div class="flex flex-col">
<div class="text-lg font-bold leading-tight tracking-tight text-gray-900 md:text-xl dark:text-white">
{{ __(section.title) }}
Expand All @@ -18,7 +18,7 @@
<!-- Settings Grid -->
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 mt-4">
<template v-for="page in section.pages">
<template v-if="!(page.disabled && env.NODE_ENV === 'production')">
<template v-if="!(page.disabled && !is_beta)">
<SettingsButton :title="page.title" :description="page.description" :icon="page.icon" :url="page.url" :disabled="page.disabled" :modal="page.modal" />
</template>
</template>
Expand All @@ -38,6 +38,7 @@ import { defineComponent } from "vue";
import { useUserStore } from "@/stores/user";
import { mapState } from "pinia";
import { useSettingsStore } from "@/stores/settings";
import { useServerStore } from "@/stores/server";
import SettingsTemplate from "@/templates/SettingsTemplate.vue";
import SettingsButton from "@/components/Buttons/SettingsButton.vue";
Expand Down Expand Up @@ -84,6 +85,7 @@ export default defineComponent({
computed: {
...mapState(useUserStore, ["user"]),
...mapState(useSettingsStore, ["search"]),
...mapState(useServerStore, ["is_beta"]),
settingsSections() {
const filteredSettingsSearch = this.search ? this.settings.map(this.mapSections).filter(this.filterSections) : this.settings;
const filteredSettingsRole = filteredSettingsSearch.map(this.mapRoles as any).filter(this.filterSections as any);
Expand Down
58 changes: 24 additions & 34 deletions apps/wizarr-frontend/src/stores/changeLog.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import toasts from '@/ts/utils/toasts';
import CacheStorage from '@/ts/utils/cacheStorage';
import type { ChangeLog, ChangeLogs } from "@/types/ChangeLog";
import { buildWebStorage, setupCache } from "axios-cache-interceptor";

import type { AxiosInstance } from 'axios';
import type { ChangeLog, ChangeLogs } from '@/types/ChangeLog';

import { defineStore } from 'pinia';
import { useAxios } from '@/plugins/axios';
import { buildWebStorage, setupCache } from 'axios-cache-interceptor';
import type { AxiosInstance } from "axios";
import CacheStorage from "@/ts/utils/cacheStorage";
import { defineStore } from "pinia";
import toasts from "@/ts/utils/toasts";
import { useAxios } from "@/plugins/axios";

const axios = useAxios();
const cachedAxios = setupCache(axios as AxiosInstance);

export const useChangeLogStore = defineStore('changeLog', {
export const useChangeLogStore = defineStore("changeLog", {
state: () => ({
cache: {} as any,
changeLogs: [] as ChangeLogs,
Expand All @@ -25,42 +24,33 @@ export const useChangeLogStore = defineStore('changeLog', {
this.fixCachedAxios(this);

// Get the change logs from the API
const reponse = await cachedAxios.get(
'https://api.github.com/repos/wizarrrr/wizarr/releases',
{
params: { per_page, page },
transformRequest: [
(data, headers) => {
delete headers['X-CSRF-TOKEN'];
delete headers['pragma'];
delete headers['expires'];
delete headers['cache-control'];
delete headers['Authorization'];
return data;
},
],
},
);
const reponse = await cachedAxios.get("https://api.github.com/repos/wizarrrr/wizarr/releases", {
params: { per_page, page },
transformRequest: [
(data, headers) => {
delete headers["X-CSRF-TOKEN"];
delete headers["pragma"];
delete headers["expires"];
delete headers["cache-control"];
delete headers["Authorization"];
return data;
},
],
});

// If we didn't get a 200, raise an error
if (reponse.status !== 200) {
toasts.error('Could not get Change Logs');
toasts.error("Could not get Change Logs");
return;
}

// Add the new change logs and update existing ones
reponse.data.forEach((changeLog: ChangeLog) => {
const index = this.changeLogs.findIndex(
(c) => c.id === changeLog.id,
);
const index = this.changeLogs.findIndex((c) => c.id === changeLog.id);
if (index === -1) {
this.changeLogs = [...this.changeLogs, changeLog];
} else {
this.changeLogs = [
...this.changeLogs.slice(0, index),
changeLog,
...this.changeLogs.slice(index + 1),
];
this.changeLogs = [...this.changeLogs.slice(0, index), changeLog, ...this.changeLogs.slice(index + 1)];
}
});
},
Expand Down
1 change: 1 addition & 0 deletions apps/wizarr-frontend/src/stores/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const useServerStore = defineStore("server", {
update_available: false as boolean,
debug: false as boolean,
setup_required: false as boolean,
is_beta: false as boolean,
latest_version: "" as string,
latest_beta_version: "" as string,
}),
Expand Down
25 changes: 25 additions & 0 deletions develop.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"folders": [
{
"name": "Wizarr [Frontend]",
"path": "./apps/wizarr-frontend"
},
{
"name": "Wizarr [Backend]",
"path": "./apps/wizarr-backend"
},
{
"name": "Wizarr [E2E]",
"path": "./apps/wizarr-e2e"
},
{
"name": "Wizarr [Project]",
"path": "."
}
],
"settings": {
"files.exclude": {
"**/apps/": true
}
}
}
2 changes: 1 addition & 1 deletion latest
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.5.1
4.0.0-beta.0
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wizarrrr/source",
"version": "3.5.0",
"version": "4.0.0",
"license": "MIT",
"scripts": {
"postinstall": "nx run-many --target=install --projects=wizarr-backend",
Expand Down
16 changes: 0 additions & 16 deletions workspace.code-workspace

This file was deleted.

0 comments on commit e648cea

Please sign in to comment.