mirror of https://github.com/Chocobozzz/PeerTube
Fix playlist cache error
parent
55bc5f4813
commit
ec10e8ed5b
|
@ -141,6 +141,8 @@ export class VideoPlaylistService {
|
||||||
return this.authHttp.post<{ videoPlaylist: { id: number } }>(VideoPlaylistService.BASE_VIDEO_PLAYLIST_URL, data)
|
return this.authHttp.post<{ videoPlaylist: { id: number } }>(VideoPlaylistService.BASE_VIDEO_PLAYLIST_URL, data)
|
||||||
.pipe(
|
.pipe(
|
||||||
tap(res => {
|
tap(res => {
|
||||||
|
if (!this.myAccountPlaylistCache) return
|
||||||
|
|
||||||
this.myAccountPlaylistCache.total++
|
this.myAccountPlaylistCache.total++
|
||||||
|
|
||||||
this.myAccountPlaylistCache.data.push({
|
this.myAccountPlaylistCache.data.push({
|
||||||
|
@ -161,6 +163,8 @@ export class VideoPlaylistService {
|
||||||
.pipe(
|
.pipe(
|
||||||
map(this.restExtractor.extractDataBool),
|
map(this.restExtractor.extractDataBool),
|
||||||
tap(() => {
|
tap(() => {
|
||||||
|
if (!this.myAccountPlaylistCache) return
|
||||||
|
|
||||||
const playlist = this.myAccountPlaylistCache.data.find(p => p.id === videoPlaylist.id)
|
const playlist = this.myAccountPlaylistCache.data.find(p => p.id === videoPlaylist.id)
|
||||||
playlist.displayName = body.displayName
|
playlist.displayName = body.displayName
|
||||||
|
|
||||||
|
@ -175,6 +179,8 @@ export class VideoPlaylistService {
|
||||||
.pipe(
|
.pipe(
|
||||||
map(this.restExtractor.extractDataBool),
|
map(this.restExtractor.extractDataBool),
|
||||||
tap(() => {
|
tap(() => {
|
||||||
|
if (!this.myAccountPlaylistCache) return
|
||||||
|
|
||||||
this.myAccountPlaylistCache.total--
|
this.myAccountPlaylistCache.total--
|
||||||
this.myAccountPlaylistCache.data = this.myAccountPlaylistCache.data
|
this.myAccountPlaylistCache.data = this.myAccountPlaylistCache.data
|
||||||
.filter(p => p.id !== videoPlaylist.id)
|
.filter(p => p.id !== videoPlaylist.id)
|
||||||
|
|
Loading…
Reference in New Issue