Compare commits

..

9 Commits

Author SHA1 Message Date
bbe6207a25 Merge branch 'master' into dcpp-socket-status 2023-01-01 17:14:18 -08:00
a47b67c6c9 🖼️ Fixed the ThreeTwo favico 2023-01-01 17:08:12 -08:00
ddef87ea29 AirDC++ Connection Status (#53)
* 🔧 Fixed empty library state with explanation

* ️ Added a status indicator for the AirDC++ socket connection
2022-12-30 22:39:38 -08:00
c09ec6bcfe ️ Added a status indicator for the AirDC++ socket connection 2022-12-31 06:21:21 +00:00
71bad167ab 🔧 Library zero state (#52)
* 🔧 Refactoring uncompression methods on client-side

* ✏️ Refactoring

* 👁️ Updates to the comic viewer

* 🖼️ Added screenshots from December 2022

* ✏️ Fixed typo in README

* 🏗️ Massive refactor around archive uncompression for reading/analysis

* 🔧 Tweaked state vars for reading and analysis

* 🏗️ Refactor to support DC++ and socket.io integration

This refactor covers the following workflows:

1. Adding a comic from LOCG or ComicVine adds it to the wanted list
2. Downloading that comic from DC++ correctly adds download metadata to the corresponding comic object in mongo
3. Successful download triggers automatic import to library and cover extraction, metadata application
2022-12-29 15:55:33 -08:00
df1fbc7dd3 🔧 Fixed empty library state with explanation 2022-12-29 23:33:23 +00:00
789e5b9518 Merge branch 'master' of https://github.com/rishighan/threetwo 2022-12-21 21:49:42 -08:00
ce6653b5d7 🏗️ Applying the refactor patc 2022-12-21 21:49:12 -08:00
d065225d8e 🏗️ Refactoring archive uncompression for "Read Comic" and "Analysis" user flows (#46)
* 🔧 Refactoring uncompression methods on client-side

* ✏️ Refactoring

* 👁️ Updates to the comic viewer

* 🖼️ Added screenshots from December 2022

* ✏️ Fixed typo in README

* 🏗️ Massive refactor around archive uncompression for reading/analysis

* 🔧 Tweaked state vars for reading and analysis

* 🏗️ Refactor to support DC++ and socket.io integration

This refactor covers the following workflows:

1. Adding a comic from LOCG or ComicVine adds it to the wanted list
2. Downloading that comic from DC++ correctly adds download metadata to the corresponding comic object in mongo
3. Successful download triggers automatic import to library and cover extraction, metadata application
2022-12-21 21:17:38 -08:00
17 changed files with 57 additions and 27 deletions

View File

@@ -182,4 +182,4 @@
"resolutions": { "resolutions": {
"@storybook/react/webpack": "^5" "@storybook/react/webpack": "^5"
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -349,4 +349,4 @@ export const analyzeImage =
type: IMG_ANALYSIS_DATA_FETCH_SUCCESS, type: IMG_ANALYSIS_DATA_FETCH_SUCCESS,
result: foo.data, result: foo.data,
}); });
}; };

View File

@@ -137,4 +137,4 @@ export const App = (): ReactElement => {
); );
}; };
export default App; export default App;

View File

@@ -336,4 +336,4 @@ export const AcquisitionPanel = (
); );
}; };
export default AcquisitionPanel; export default AcquisitionPanel;

View File

@@ -317,4 +317,4 @@ export const ComicDetail = (data: ComicDetailProps): ReactElement => {
); );
}; };
export default ComicDetail; export default ComicDetail;

View File

@@ -94,4 +94,4 @@ RawFileDetails.propTypes = {
}), }),
}), }),
}), }),
}; };

View File

@@ -126,4 +126,4 @@ export const ArchiveOperations = (props): ReactElement => {
); );
}; };
export default ArchiveOperations; export default ArchiveOperations;

View File

@@ -94,4 +94,4 @@ export const Dashboard = (): ReactElement => {
); );
}; };
export default Dashboard; export default Dashboard;

View File

@@ -161,4 +161,4 @@ export const PullList = ({ issues }: PullListProps): ReactElement => {
); );
}; };
export default PullList; export default PullList;

View File

@@ -2,7 +2,6 @@ import React, { ReactElement } from "react";
import Card from "../Carda"; import Card from "../Carda";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import ellipsize from "ellipsize"; import ellipsize from "ellipsize";
import { escapePoundSymbol } from "../../shared/utils/formatting.utils";
import { isEmpty, isNil, isUndefined, map } from "lodash"; import { isEmpty, isNil, isUndefined, map } from "lodash";
import { detectIssueTypes } from "../../shared/utils/tradepaperback.utils"; import { detectIssueTypes } from "../../shared/utils/tradepaperback.utils";
import Masonry from "react-masonry-css"; import Masonry from "react-masonry-css";
@@ -52,7 +51,6 @@ export const RecentlyImported = ({
}, },
idx, idx,
) => { ) => {
console.log(comicvine);
const { issueName, url } = determineCoverFile({ const { issueName, url } = determineCoverFile({
rawFileDetails, rawFileDetails,
comicvine, comicvine,
@@ -64,7 +62,6 @@ export const RecentlyImported = ({
comicInfo, comicInfo,
locg, locg,
}); });
console.log(name);
const isComicBookMetadataAvailable = const isComicBookMetadataAvailable =
!isUndefined(comicvine) && !isUndefined(comicvine) &&
!isUndefined(comicvine.volumeInformation); !isUndefined(comicvine.volumeInformation);
@@ -146,4 +143,4 @@ export const RecentlyImported = ({
</Masonry> </Masonry>
</> </>
); );
}; };

View File

@@ -208,14 +208,13 @@ export const Library = (): ReactElement => {
// ImportStatus.propTypes = { // ImportStatus.propTypes = {
// value: PropTypes.bool.isRequired, // value: PropTypes.bool.isRequired,
// }; // };
return ( return (
<section className="container"> <section className="container">
<div className="section"> <div className="section">
<div className="header-area"> <div className="header-area">
<h1 className="title">Library</h1> <h1 className="title">Library</h1>
</div> </div>
{!isUndefined(searchResults.hits) && ( {!isEmpty(searchResults) ? (
<div> <div>
<div className="library"> <div className="library">
<T2Table <T2Table
@@ -230,7 +229,25 @@ export const Library = (): ReactElement => {
/> />
</div> </div>
</div> </div>
)} ): <div className="columns">
<div className="column is-two-thirds">
<article className="message is-link">
<div className="message-body">
No comics were found in the library, Elasticsearch reports no
indices. Try importing a few comics into the library and come
back.
</div>
</article>
<pre>
{!isUndefined(searchError.data) &&
JSON.stringify(
searchError.data.meta.body.error.root_cause,
null,
4,
)}
</pre>
</div>
</div> }
</div> </div>
</section> </section>
); );

View File

@@ -1,15 +1,17 @@
import React from "react"; import React, { useContext } from "react";
import { SearchBar } from "./GlobalSearchBar/SearchBar"; import { SearchBar } from "./GlobalSearchBar/SearchBar";
import { DownloadProgressTick } from "./ComicDetail/DownloadProgressTick"; import { DownloadProgressTick } from "./ComicDetail/DownloadProgressTick";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import { useSelector } from "react-redux"; import { useSelector } from "react-redux";
import { isUndefined } from "lodash"; import { isUndefined, isEmpty } from "lodash";
import { AirDCPPSocketContext } from "../context/AirDCPPSocket";
const Navbar: React.FunctionComponent = (props) => { const Navbar: React.FunctionComponent = (props) => {
const downloadProgressTick = useSelector( const downloadProgressTick = useSelector(
(state: RootState) => state.airdcpp.downloadProgressData, (state: RootState) => state.airdcpp.downloadProgressData,
); );
const airDCPPConfiguration = useContext(AirDCPPSocketContext);
console.log(airDCPPConfiguration)
return ( return (
<nav className="navbar is-fixed-top"> <nav className="navbar is-fixed-top">
<div className="navbar-brand"> <div className="navbar-brand">
@@ -80,10 +82,23 @@ const Navbar: React.FunctionComponent = (props) => {
<div className="navbar-dropdown download-progress-meter"> <div className="navbar-dropdown download-progress-meter">
<a className="navbar-item"> <a className="navbar-item">
<DownloadProgressTick data={downloadProgressTick} /> <DownloadProgressTick data={downloadProgressTick} />
</a> </a> </div>
</div>
) : null} ) : null}
</div> </div>
{/* AirDC++ socket connection status */}
<div className="navbar-item has-dropdown is-hoverable">
<a className="navbar-link is-arrowless has-text-success">
{!isEmpty(airDCPPConfiguration.airDCPPState.socketConnectionInformation) ? (
<i className="fa-solid fa-bolt"></i>) : null}
</a>
<div className="navbar-dropdown download-progress-meter">
<a className="navbar-item">
<pre>{JSON.stringify(airDCPPConfiguration.airDCPPState.socketConnectionInformation, null, 2)}</pre>
</a>
</div>
</div>
<div className="navbar-item has-dropdown is-hoverable is-mega"> <div className="navbar-item has-dropdown is-hoverable is-mega">
<div className="navbar-link flex">Blog</div> <div className="navbar-link flex">Blog</div>
<div id="blogDropdown" className="navbar-dropdown"> <div id="blogDropdown" className="navbar-dropdown">

View File

@@ -137,4 +137,4 @@ export const SETTINGS_DB_FLUSH_SUCCESS = "SETTINGS_DB_FLUSH_SUCCESS";
// Metron Metadata // Metron Metadata
export const METRON_DATA_FETCH_SUCCESS = "METRON_DATA_FETCH_SUCCESS"; export const METRON_DATA_FETCH_SUCCESS = "METRON_DATA_FETCH_SUCCESS";
export const METRON_DATA_FETCH_IN_PROGRESS = "METRON_DATA_FETCH_IN_PROGRESS"; export const METRON_DATA_FETCH_IN_PROGRESS = "METRON_DATA_FETCH_IN_PROGRESS";
export const METRON_DATA_FETCH_ERROR = "METRON_DATA_FETCH_ERROR"; export const METRON_DATA_FETCH_ERROR = "METRON_DATA_FETCH_ERROR";

View File

@@ -12,7 +12,7 @@ const AirDCPPSocketContextProvider = ({ children }) => {
airDCPPState: { airDCPPState: {
settings: settingsObject, settings: settingsObject,
socket: {}, socket: {},
socketConnectionInformation: {}, socketConectionInformation: {},
}, },
}); });
}; };
@@ -56,11 +56,12 @@ const AirDCPPSocketContextProvider = ({ children }) => {
hostname: `${host.hostname}:${host.port}`, hostname: `${host.hostname}:${host.port}`,
}); });
const socketConnectionInformation = await initializedAirDCPPSocket.connect( let socketConnectionInformation = await initializedAirDCPPSocket.connect(
`${host.username}`, `${host.username}`,
`${host.password}`, `${host.password}`,
true, true,
); );
persistSettings({ persistSettings({
...airDCPPState, ...airDCPPState,
airDCPPState: { airDCPPState: {
@@ -80,7 +81,7 @@ const AirDCPPSocketContextProvider = ({ children }) => {
}; };
const AirDCPPSocketContext = createContext({ const AirDCPPSocketContext = createContext({
airDCPPState: {}, airDCPPState: {},
saveSettings: () => {}, saveSettings: () => { },
}); });
export { AirDCPPSocketContext, AirDCPPSocketContextProvider }; export { AirDCPPSocketContext, AirDCPPSocketContextProvider };

View File

@@ -283,4 +283,4 @@ function fileOpsReducer(state = initialState, action) {
} }
} }
export default fileOpsReducer; export default fileOpsReducer;

View File

@@ -90,4 +90,4 @@ export const determineExternalMetadata = (
default: default:
break; break;
} }
}; };