mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-06 13:02:23 -07:00
Medium Support (Multi-disc Albums), Quality Grouping (#121)
* Multi Disc Stage 1 - Backend Work * Quality Group Functionality * Fixed: Only show wanted album types on ArtistDetail page * Add Media Count Column to ArtistDetail Page * Parser updates for multidisc cases, other usenet release title formats * Search for Tracks by Medium Number in Addition to Title and TrackNumber * Medium Renaming Token for Track Naming * fixup Codacy and Comment Cleanup * fixup remove comments
This commit is contained in:
parent
e1e7cad951
commit
21428cba6f
154 changed files with 2946 additions and 701 deletions
|
@ -26,6 +26,14 @@ function getState(status) {
|
|||
}
|
||||
}
|
||||
|
||||
function isAppDisconnected(disconnectedTime) {
|
||||
if (!disconnectedTime) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return Math.floor(new Date().getTime() / 1000) - disconnectedTime > 180;
|
||||
}
|
||||
|
||||
function createMapStateToProps() {
|
||||
return createSelector(
|
||||
(state) => state.app.isReconnecting,
|
||||
|
@ -66,6 +74,7 @@ class SignalRConnector extends Component {
|
|||
this.signalRconnection = null;
|
||||
this.retryInterval = 5;
|
||||
this.retryTimeoutId = null;
|
||||
this.disconnectedTime = null;
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
@ -90,7 +99,7 @@ class SignalRConnector extends Component {
|
|||
// Control
|
||||
|
||||
retryConnection = () => {
|
||||
if (this.retryInterval >= 30) {
|
||||
if (isAppDisconnected(this.disconnectedTime)) {
|
||||
this.setState({
|
||||
isDisconnected: true
|
||||
});
|
||||
|
@ -290,6 +299,9 @@ class SignalRConnector extends Component {
|
|||
console.log(`SignalR: ${state}`);
|
||||
|
||||
if (state === 'connected') {
|
||||
// Clear disconnected time
|
||||
this.disconnectedTime = null;
|
||||
|
||||
// Repopulate the page (if a repopulator is set) to ensure things
|
||||
// are in sync after reconnecting.
|
||||
|
||||
|
@ -322,6 +334,10 @@ class SignalRConnector extends Component {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!this.disconnectedTime) {
|
||||
this.disconnectedTime = Math.floor(new Date().getTime() / 1000);
|
||||
}
|
||||
|
||||
this.props.setAppValue({
|
||||
isReconnecting: true
|
||||
});
|
||||
|
@ -332,11 +348,14 @@ class SignalRConnector extends Component {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!this.disconnectedTime) {
|
||||
this.disconnectedTime = Math.floor(new Date().getTime() / 1000);
|
||||
}
|
||||
|
||||
this.props.setAppValue({
|
||||
isConnected: false,
|
||||
isReconnecting: true
|
||||
// Don't set isDisconnected yet, it'll be set it if it's disconnected
|
||||
// for ~105 seconds (retry interval reaches 30 seconds)
|
||||
isReconnecting: true,
|
||||
isDisconnected: isAppDisconnected(this.disconnectedTime)
|
||||
});
|
||||
|
||||
this.retryConnection();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue