---
# System prepended metadata

title: Untitled

---

```mermaid
flowchart LR
    A((start))
    B>content update]
    
    C{"salability in (FREE, FREE_ADS) \n & publishStatus = PUBLISH \n  duration > 0"}
    D[Check-in content]
    E[Check-out content]
    F{"#blocked_contents == 0 \n & #available_contents >\n #blocked_contents + 1"}
    G[initialize blocked contents]
    H[update schedule]
    I[set timer for content]
    
    
    K>content finished]
    L{#blocked_contents == #blocked_ahead_size \n &amp #available_contents > 0}
    Z((end))
    
   
    
    A --> B
    B --> C
    C -->|yes| D
    C -->|no| E
    E --> F
    D --> F
    F -->|yes|G
    F -->|no|B
    G --> H
    H --> I
    I -.-> K
    I --> B
    K --> L
    L -->|yes| H
    L -->|no| Z
```

```mermaid
flowchart LR
    A((start))
    BB["channelContents.put(content)]\n availableContents.put(content)"]
    Z((end))
    
    A -->BB
    BB --> Z
```


```mermaid
flowchart LR
    A((start))
    B{content == currentContent}
    C[deleteTimer \n &amp update schedule]
    D{"history.contains(content)"}
    E["history.remove(content)"]
    F{"blockedContents.contains(content)"}
    G["blockedContents.remove(content) \n & addNextBlockedItem \n & emit(currentContent + blockedContent)"]
    H{"availableContents.contains(content)"}
    I["availableContents.remove(content)"]
    J{"channelContents.contains(content)"}
    K["channelContents.remove(content)"]
    Z((end))
    
    A --> B
    B -->|yes| C
    C -->D
    B -->|no| D
    D -->|yes| E
    E --> F
    D -->|no| F
    F -->|yes| G
    F -->|no|H
    G -->H
    H -->|yes| I
    H -->|no| J
    J -->|yes| K
    J -->|no| Z
    I --> J
    K --> Z    
```

```mermaid
flowchart LR
A((start))
B{currentContent.any}
C["channelContents[currentContent].visualizations+=1 \n history.add(currentContent)
availableContents.add(history.pop(0))"]
D{blockedContents.any}
E["currentContent = blockedContents.pop(0)
timer.set(currentContent.duration)
addNextBlockedItem()"]
F[/"emit(currentContent + blockedContent)"/]
Z((end))

A --> B
B -->|yes| C
B -->|no| D
C --> D
D -->|yes| E
D -->|no| F
E --> F
F --> Z
```