🔧 Fixes to AirDCPP searching WIP

1. Fixed the iterable for search results
2. Updated README
3. Listeners still a ?
This commit is contained in:
2021-09-02 14:45:44 -07:00
parent 3fc22c74ef
commit 1f8e0d6ff6
5 changed files with 32 additions and 22 deletions

View File

@@ -8,7 +8,7 @@ COPY package.json yarn.lock /usr/src/threetwo/
COPY nodemon.json /usr/src/threetwo
COPY jsdoc.json /usr/src/threetwo
RUN apk add --no-cache --virtual .build-deps make gcc g++ python \
RUN apk add --no-cache --virtual .build-deps git automake autoconf \
&& yarn \
&& apk del .build-deps

View File

@@ -35,11 +35,11 @@ Then:
6. Note that the first time, the process could take up to 10 minutes, since it is building containers for `threetwo`, `threetwo-import-service`, `comicvine-service`, `mongo`, `nats`, `nginx`
7. For posterity, check that all containers are up using `docker ps`
### What runs where
### Ports
`threetwo` is the UI that is served on port `3050`
`import` service is served on `3000`
`comicvine` service on `3080`
1. `threetwo`, the UI runs on port `8050`
2. `import` service on `3000`
3. `comicvine` service on `3080`
## Local Development

View File

@@ -89,6 +89,10 @@ export const search = (data: SearchData) => async (dispatch) => {
// Finally, perform the actual search
await SocketService.post(`search/${instance.id}/hub_search`, data);
// removeSearchesSentListener();
// removeSeachResultAddedListener();
// removeSearchResultUpdatedListener();
} catch (error) {
console.log("ERO", error);
throw error;

View File

@@ -117,25 +117,23 @@ export const AcquisitionPanel = (
</tr>
</thead>
<tbody>
<tr><td>
{JSON.stringify(airDCPPSearchResults)}</td></tr>
{/* {map(airDCPPSearchResults, ({ name, type, slots, users, id }) => {
{map(airDCPPSearchResults, ({ result }) => {
return (
<tr key={id}>
<tr key={result.id}>
<td>
<p className="mb-2">
{type.id === "directory" ? (
{result.type.id === "directory" ? (
<i className="fas fa-folder"></i>
) : null}{" "}
{name}
{result.name}
</p>
<dl>
<dd>
<div className="tags">
<span className="tag is-light is-info">
{users.user.nicks}
{result.users.user.nicks}
</span>
{users.user.flags.map((flag, idx) => (
{result.users.user.flags.map((flag, idx) => (
<span className="tag is-light" key={idx}>
{flag}
</span>
@@ -146,15 +144,19 @@ export const AcquisitionPanel = (
</td>
<td>
<span className="tag is-light is-info">
{type.id === "directory" ? "directory" : type.str}
{result.type.id === "directory"
? "directory"
: result.type.str}
</span>
</td>
<td>
<div className="tags has-addons">
<span className="tag is-success">
{slots.free} free
{result.slots.free} free
</span>
<span className="tag is-light">
{result.slots.total}
</span>
<span className="tag is-light">{slots.total}</span>
</div>
</td>
<td>
@@ -162,7 +164,7 @@ export const AcquisitionPanel = (
onClick={() =>
downloadDCPPResult(
searchInstance.id,
id,
result.id,
props.comicBookMetadata._id,
)
}
@@ -172,7 +174,7 @@ export const AcquisitionPanel = (
</td>
</tr>
);
})} */}
})}
</tbody>
</table>
)}

View File

@@ -20,10 +20,9 @@ const initialState = {
function airdcppReducer(state = initialState, action) {
switch (action.type) {
case AIRDCPP_SEARCH_RESULTS_RECEIVED:
console.log("Badan", action)
return {
...state,
searchResults: action.groupedResult.result,
searchResults: [...state.searchResults, action.groupedResult],
isAirDCPPSearchInProgress: false,
};
case AIRDCPP_SEARCH_IN_PROGRESS:
@@ -56,11 +55,16 @@ function airdcppReducer(state = initialState, action) {
};
case LOCATION_CHANGE:
return {
initialState,
searchResults: [],
isAirDCPPSearchInProgress: false,
searchInfo: null,
searchInstance: null,
downloadResult: null,
bundleDBImportResult: null,
};
default:
return { ...state };
return state;
}
}