Skip to content

Commit

Permalink
play with ios file
Browse files Browse the repository at this point in the history
  • Loading branch information
wkelly17 committed Apr 25, 2024
1 parent a68d44d commit b2a9c73
Show file tree
Hide file tree
Showing 18 changed files with 50 additions and 39 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
# apply provisioning profile
Expand Down
3 changes: 2 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"noConsoleLog": "warn"
},
"correctness": {
"noUnusedVariables": "error"
"noUnusedVariables": "error",
"useExhaustiveDependencies": "warn"
},
"complexity": {
"noUselessCatch": "warn"
Expand Down
2 changes: 1 addition & 1 deletion src/components/ChapterSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useRef } from "react";
import { IVidWithCustom } from "../customTypes/types";
import type { IVidWithCustom } from "../customTypes/types";
import { ChapterList } from "./ChapterList";
import {
IconMaterialSymbolsChevronLeft,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Icons.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SVGProps } from "react";
import type { SVGProps } from "react";

interface IconProps {
classNames?: string;
Expand Down
8 changes: 4 additions & 4 deletions src/components/Player.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Dispatch, SetStateAction, useEffect, useRef } from "react";
import { VideoJsPlayer } from "video.js";
import { IVidWithCustom, chapterMarkers } from "../customTypes/types";
import { type Dispatch, type SetStateAction, useEffect, useRef } from "react";
import type { VideoJsPlayer } from "video.js";
import type { IVidWithCustom, chapterMarkers } from "../customTypes/types";
import { handleVideoJsTaps, playerCustomHotKeys } from "../lib/Ui";
import { getSavedAppPreferences } from "../lib/storage";
type Iplayer = {
Expand Down Expand Up @@ -40,7 +40,7 @@ export function VidJsPlayer({
? {
src: `${firstBook.savedSources?.video}`,
type: "video/mp4",
}
}
: firstBook.sources;

const firstPoster = firstBook.savedSources?.poster
Expand Down
4 changes: 2 additions & 2 deletions src/components/PlaylistBookPicker.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Dispatch, SetStateAction } from "react";
import type { Dispatch, SetStateAction } from "react";
import { useTranslation } from "react-i18next";
import { IVidWithCustom } from "../customTypes/types";
import type { IVidWithCustom } from "../customTypes/types";
import { manageShowingChapterArrows } from "../lib/Ui";
import { normalizeBookName } from "../lib/utils";
import { IconMaterialSymbolsCheckCircle } from "./Icons";
Expand Down
2 changes: 1 addition & 1 deletion src/components/PlaylistInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IVidWithCustom, validPlaylistSlugs } from "../customTypes/types";
import type { IVidWithCustom, validPlaylistSlugs } from "../customTypes/types";
import { formatPlayListName, normalizeBookName } from "../lib/utils";
import { IconMaterialSymbolsCheckCircle } from "./Icons";
type IPlaylistInfo = {
Expand Down
12 changes: 9 additions & 3 deletions src/components/Settings.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import { IonButton, IonIcon, IonModal } from "@ionic/react";
import { close } from "ionicons/icons";
import { settingsOutline } from "ionicons/icons";
import { Dispatch, SetStateAction, useEffect, useRef, useState } from "react";
import { useTranslation } from "react-i18next";
import { VideoJsPlayer } from "video.js";
import {
type Dispatch,
type SetStateAction,
useEffect,
useRef,
useState,
} from "react";
import { useTranslation } from "react-i18next";
import type { VideoJsPlayer } from "video.js";
import type {
IPlaylistData,
IVidWithCustom,
downloadProgressInfo,
Expand Down
10 changes: 5 additions & 5 deletions src/components/Settings/BulkListing.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { CheckboxCustomEvent, IonButton } from "@ionic/react";
import { Dispatch, SetStateAction, useState } from "react";
import { type CheckboxCustomEvent, IonButton } from "@ionic/react";
import { type Dispatch, type SetStateAction, useState } from "react";
import { useTranslation } from "react-i18next";
import {
import type {
IPlaylistData,
IVidWithCustom,
validPlaylistSlugs,
} from "../../customTypes/types";
import { downloadProgressInfo } from "../../customTypes/types";
import type { downloadProgressInfo } from "../../customTypes/types";
import {
getCurrentPlaylistDataFs,
getDownloadSize,
Expand Down Expand Up @@ -214,7 +214,7 @@ export function BulkListing({
size="small"
fill="outline"
color="primary"
disabled={booksSelected?.length ? false : true}
disabled={!booksSelected?.length}
className="text-surface"
onClick={() => {
if (downloadProgress?.started) {
Expand Down
9 changes: 6 additions & 3 deletions src/components/Settings/DownloadBookItem.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { CheckboxCustomEvent } from "@ionic/core";
import type { CheckboxCustomEvent } from "@ionic/core";
import { IonButton, IonCheckbox, IonProgressBar } from "@ionic/react";
import { Dispatch, SetStateAction } from "react";
import type { Dispatch, SetStateAction } from "react";
import { useTranslation } from "react-i18next";
import { IVidWithCustom, downloadProgressInfo } from "../../customTypes/types";
import type {
IVidWithCustom,
downloadProgressInfo,
} from "../../customTypes/types";
import { IconCancelX, IconMaterialSymbolsCheckCircle } from "../Icons";

type BookToDownloadProps = {
Expand Down
4 changes: 2 additions & 2 deletions src/components/Settings/SpeedControl.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ChangeEvent, useEffect, useState } from "react";
import { type ChangeEvent, useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { VideoJsPlayer } from "video.js";
import type { VideoJsPlayer } from "video.js";
import {
getSavedAppPreferences,
updateSavedAppPreferences,
Expand Down
2 changes: 1 addition & 1 deletion src/components/VerseSegmentJump.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useState } from "react";

import {
import type {
IVidWithCustom,
IadjacentChap,
IvidJsPlayer,
Expand Down
4 changes: 2 additions & 2 deletions src/customTypes/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import videojs from "video.js";
import brightCovePlaylistConfig from "../brightcove/playlist-mappers";
import type videojs from "video.js";
import type brightCovePlaylistConfig from "../brightcove/playlist-mappers";
import type { PlaylistResponse, Video, VideoSources } from "./bcApi";

declare global {
Expand Down
6 changes: 3 additions & 3 deletions src/lib/Ui.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Directory, Encoding, Filesystem } from "@capacitor/filesystem";

import { Dispatch, SetStateAction } from "react";
import {
import type { Dispatch, SetStateAction } from "react";
import type {
IPlaylistData,
IPlaylistResponse,
IVidWithCustom,
Expand Down Expand Up @@ -391,7 +391,7 @@ export async function updatePrefsInBackground({
}
}

// biome-ignore lint/correctness/noUnusedVariables: I'm destructuring to pick off the videos and formatted because we are using updating those properties with the spread on cacheBcPlaylistJson
// I'm destructuring to pick off the videos and formatted because we are using updating those properties with the spread on cacheBcPlaylistJson
const { videos, formattedVideos, ...restPlaylistData } = data;
mutateTimeStampBcResponse(restPlaylistData);

Expand Down
8 changes: 4 additions & 4 deletions src/lib/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { Capacitor } from "@capacitor/core";
import { Directory, Filesystem } from "@capacitor/filesystem";
import { Preferences } from "@capacitor/preferences";
import write_blob from "capacitor-blob-writer";
import {
import type {
IPlaylistData,
IVidWithCustom,
fetchSession,
writeAnInProgressBlobParams,
} from "src/customTypes/types";
import {
import type {
IappState,
validPlaylistSlugs,
vidSavingWipData,
Expand Down Expand Up @@ -65,7 +65,7 @@ export function makeVidSaver(
return lowestMp4Size;
},
async savePosterBlobAndGetSrc() {
let posterBlob;
let posterBlob: Blob | undefined;
const posterPath = `${playlist}/${vid.id}/poster.jpeg`;
if (vid.poster) {
try {
Expand Down Expand Up @@ -107,7 +107,7 @@ export function makeVidSaver(
if (contentLength === null) {
return -1;
}
const fileSize = parseInt(contentLength, 10);
const fileSize = Number.parseInt(contentLength, 10);
return fileSize;
} catch (error) {
console.warn(error);
Expand Down
4 changes: 2 additions & 2 deletions src/lib/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IVidWithCustom, validPlaylistSlugs } from "../customTypes/types";
import type { IVidWithCustom, validPlaylistSlugs } from "../customTypes/types";

interface sortOrderI {
[key: string]: number;
Expand Down Expand Up @@ -179,7 +179,7 @@ export function massageVidsArray(vids: IVidWithCustom[]) {
const bBookSort = getBibleBookSort(bCustomBook);
const aChap = Number(a.custom_fields?.chapter);
const bChap = Number(b.custom_fields?.chapter);
let retVal;
let retVal: undefined | number;
if (aBookSort === bBookSort) {
retVal = aChap < bChap ? -1 : aChap === bChap ? 0 : 1;
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import "virtual:uno.css";
import React from "react";
import { createRoot } from "react-dom/client";
import App from "./App";
import "./i18n/i18nnext";
import "virtual:uno.css";

const container = document.getElementById("root");

Expand Down
6 changes: 3 additions & 3 deletions src/pages/Playlist.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { PlaylistBookPicker } from "../components/PlaylistBookPicker";
import { PlaylistInfo } from "../components/PlaylistInfo";
import { Settings } from "../components/Settings";
import { VerseSegmentJump } from "../components/VerseSegmentJump";
import {
import type {
IPlaylistData,
IPlaylistResponse,
IVidWithCustom,
Expand Down Expand Up @@ -89,8 +89,8 @@ function Playlist() {
savedPoster
? plyr?.poster(savedPoster)
: vid.poster
? plyr?.poster(vid.poster)
: null;
? plyr?.poster(vid.poster)
: null;
plyr?.one("loadedmetadata", () => {
handleChapters(vid, plyr);
});
Expand Down

0 comments on commit b2a9c73

Please sign in to comment.