Skip to content

Commit

Permalink
Merge pull request #7 from Anime-Manga/dev
Browse files Browse the repository at this point in the history
## [2.1.0] - 16-10-2023
  • Loading branch information
cesxhin authored Oct 16, 2023
2 parents b12df6a + 16abdce commit 250c4af
Show file tree
Hide file tree
Showing 39 changed files with 1,534 additions and 582 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
id: meta
uses: docker/[email protected]
with:
images: ${{ secrets.DOCKER_USER }}/animemanga-web:2.0.0
images: ${{ secrets.DOCKER_USER }}/animemanga-web:2.1.0

- name: Build the Docker image Web
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile
push: true
tags: ${{ secrets.DOCKER_USER }}/animemanga-web:2.0.0, ${{ secrets.DOCKER_USER }}/animemanga-web:latest
tags: ${{ secrets.DOCKER_USER }}/animemanga-web:2.1.0, ${{ secrets.DOCKER_USER }}/animemanga-web:latest
16 changes: 16 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Released]
## [2.1.0] - 16-10-2023
### Added
- label "alpha" for share room
- Lib notify

### Fixed
- Events with WS when room is shared
- With custom controls maybe improved experience with share room

### Changed
- Use axios
- Show pages when finished download image
- Only administrator can direct download book/video and he can accept or reject or add to blacklist the request
from guest or basic account
- Controls of the video

## [2.0.1] - 17-06-2023
### Added
- use default cookie for set auth with encryption
Expand Down
200 changes: 96 additions & 104 deletions src/components/card/details/detailsCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,70 +23,44 @@
<template
v-if="!isNil(item.urlPageDownload)"
>
<v-btn
<template v-if="useGet(store.getUser, 'role', 0) === 100">
<ButtonLoading
:action="download"
color="warning"
@click="download()"
>
<template
v-if="isLoadingDownload"
>
<v-progress-circular
indeterminate
size="25"
/>
</template>
<template
v-else
>
<v-icon>
$download
</v-icon>
</template>
</v-btn>
icon="$download"
/>
</template>
<template v-else>
<ButtonRequestDownload
:name="item.name"
:url="item.urlPageDownload"
:nameCfg="store.getSchemasBySelectSearch.nameCfg"
:type="item.type"
/>
</template>
</template>
<template v-else>
<v-btn
color="warning"
class="mr-1"
@click="reDownload()"
>
<template v-if="isLoadingReDownload">
<v-progress-circular
indeterminate

<template v-if="useGet(store.getUser, 'role', 0) === 100">
<ButtonLoading
:action="reDownload"
color="warning"
icon="$redownload"
class="mr-1"
/>
</template>
<template
v-else
>
<v-icon>
$redownload
</v-icon>
</template>
</v-btn>
<v-btn
color="error"
@click="remove()"
>
<template v-if="isLoadingDelete">
<v-progress-circular
indeterminate

<ButtonLoading
:action="remove"
color="error"
icon="$trash"
/>
</template>
<template v-else>
<v-icon>
$trash
</v-icon>
</template>
</v-btn>
</template>
<template v-if="!isNil(store.getUser) || !isNil(item.watchList)">
<v-btn
<ButtonLoading
:action="() => setWatchList(item.watchList)"
color="info ml-1"
@click="setWatchList(item.watchList)"
>
<v-icon>
{{item.watchList? '$saved' : '$notSaved'}}
</v-icon>
</v-btn>
:icon="item.watchList? '$saved' : '$notSaved'"
/>
</template>
</template>
</v-card-item>
Expand Down Expand Up @@ -133,7 +107,7 @@
const store = useStore();
//api
const {downloadContent, reDownloadContent, removeContent, addWatchList, removeWatchList, getStatus} = useApi();
const {downloadContent, reDownloadContent, removeContent, addWatchList, removeWatchList, getStatus, apiAsync} = useApi();
const emit = defineEmits(['closeDialog','closeDialogAndUpdate','updateData']);
Expand All @@ -148,74 +122,81 @@ const {item} = toRefs(props);
//variables
const activator = ref(true);
const isLoadingDownload = ref(false);
const isLoadingReDownload = ref(false);
const isLoadingDelete = ref(false);
const error = ref(null);
const date = ref(null);
const contents = ref(null);
const tokenStatus = ref();
watch(item, () => date.value = new Date());
watch(date, () => {
if(isNil(item.value.urlPageDownload))
{
setTimeout(async () => {
try{
contents.value = await getStatus(item.value.type, item.value.name_id, item.value.nameCfg);
}catch(err){
console.log(err);
}finally{
date.value = new Date();
}
tokenStatus.value = setTimeout(async () => {
await apiAsync(
getStatus({
name: item.value.name_id
}, item.value.type),
(data) => contents.value = data,
null,
() => date.value = new Date(),
null,
true
);
}, 1000);
}
}, {immediate: true})
async function download(){
isLoadingDownload.value = true;
try{
let schema = store.getSchemasBySelectSearch;
let data = await downloadContent(item.value.type, item.value.urlPageDownload, schema.nameCfg);
emit('updateData', data);
}catch(err){
console.log(err);
error.value = `Impossible send request for download this ${item.value.urlPageDownload}`;
}finally{
isLoadingDownload.value = false;
}
let schema = store.getSchemasBySelectSearch;
await apiAsync(
downloadContent({
username: store.getUser?.username
},{
url: item.value.urlPageDownload,
nameCfg: schema.nameCfg
}, item.value.type),
(data) => emit('updateData', data),
() => error.value = `Impossible send request for download this ${item.value.urlPageDownload}`,
);
}
async function reDownload(){
isLoadingReDownload.value = true;
error.value = null;
try{
await reDownloadContent(item.value.type, item.value.name_id);
}catch{
error.value = `Impossible send request for re-download this ${item.value.urlPageDownload}`;
}finally{
isLoadingReDownload.value = false;
}
await apiAsync(
reDownloadContent({
name: item.value.name_id,
username: store.getUser?.username
}, null, item.value.type),
null,
() => error.value = `Impossible send request for re-download this ${item.value.urlPageDownload}`,
() => isLoadingReDownload.value = false
);
}
async function remove(){
isLoadingDelete.value = true;
error.value = null;
try{
await removeContent(item.value.type, item.value.name_id, item.value.nameCfg);
closeAndUpdate();
}catch(err){
console.log(err);
error.value = `Impossible send request for remove this ${item.value.urlPageDownload}`;
}finally{
isLoadingDelete.value = false;
}
await apiAsync(
removeContent({
name: item.value.name_id,
nameCfg: item.value.nameCfg,
username: store.getUser?.username
}, null, item.value.type),
() => {
clearTimeout(tokenStatus.value);
closeAndUpdate();
},
() => error.value = `Impossible send request for remove this ${item.value.urlPageDownload}`,
() => isLoadingDelete.value = false
);
}
function closeAndUpdate(){
Expand All @@ -228,14 +209,25 @@ function close(){
async function setWatchList(state){
let username = store.getUser?.username;
try {
if(state === true)
await removeWatchList(username, item.value.name_id, item.value.nameCfg);
else
await addWatchList(username, item.value.name_id, item.value.nameCfg);
if(state === true){
await apiAsync(
removeWatchList(null, {
username,
name: item.value.name_id,
nameCfg: item.value.nameCfg
})
)
}else{
await apiAsync(
addWatchList(null, {
username,
name: item.value.name_id,
nameCfg: item.value.nameCfg
})
)
}
item.value.watchList = !state;
}catch{}
item.value.watchList = !state;
}
</script>
Expand Down
27 changes: 19 additions & 8 deletions src/components/card/details/getStarted.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const props = defineProps({
const {item, contents} = toRefs(props);
//api
const {getProgress} = useApi();
const {getProgress, apiAsync} = useApi();
const store = useStore();
Expand Down Expand Up @@ -116,13 +116,24 @@ watch(foundMedia, (newVal, oldVal) => {
async function setProgress(){
if(!isNil(store.getUser) && isNil(item.value.urlPageDownload))
{
try{
progressTracker.value = await getProgress(item.value.type, item.value.name_id, store.getUser?.username, item.value.nameCfg);
foundProgress.value = true;
}catch(err){
if(err.response.status === 404)
foundProgress.value = false;
}
await apiAsync(
getProgress({
name: item.value.name_id,
username: store.getUser?.username,
nameCfg: item.value.nameCfg
}, item.value.type),
(data) => {
progressTracker.value = data
foundProgress.value = true;
},
(err) => {
if(err.response.status === 404)
foundProgress.value = false;
},
null,
null,
true
)
}
}
Expand Down
16 changes: 11 additions & 5 deletions src/components/card/preview/previewCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const {isNil} = useLodash();
const store = useStore();
//api
const {getByName} = useApi();
const {getByName, apiAsync} = useApi();
//variabvles
const activeModal = ref(null);
Expand Down Expand Up @@ -86,10 +86,16 @@ async function details() {
if (!_.isNil(item.value.exists) && item.value.exists === true) {
const {nameCfg} = store.getSchemasBySelectSearch
data.value = await getByName(item.value.typeView, item.value.name, nameCfg)
activeModal.value = 'detailsCard'
} else
activeModal.value = 'detailsCard'
await apiAsync(
getByName({
name: item.value.name,
nameCfg
}, item.value.typeView),
(rs) => data.value = rs
)
}
activeModal.value = 'detailsCard'
}
function closeDialog() {
Expand Down
Loading

0 comments on commit 250c4af

Please sign in to comment.