-
-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Atem source #501
Improve Atem source #501
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks quite good to me 👍
I couldn't test this, though, due to not having much time currently.
@@ -47,7 +47,7 @@ <h2> | |||
</table> | |||
</div> | |||
<div class="alert alert-info mt-3" role="alert" *ngIf="getNetworkDiscoveryList().length > 0"> | |||
Found {{ getNetworkDiscoveryList().length }} new sources in your network. | |||
Found {{ getNetworkDiscoveryList().length }} new {{ getNetworkDiscoveryList().length === 1 ? 'source' : 'sources' }} in your network. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recently read that it's bad practice to call functions in an angular template... however, as it was already there, we could probably leave it that way. I just thought I'd mention it since we're now calling that function at least twice as often.
@@ -127,6 +130,9 @@ export class BlackmagicATEMSource extends TallyInput { | |||
} | |||
|
|||
private processATEMTally(): void { | |||
const areSetsEqual = (a, b) => a.size === b.size && [...a].every(value => b.has(value)); //https://stackoverflow.com/a/44827922 | |||
if(areSetsEqual(this.prvList, this.oldPrvList) && areSetsEqual(this.pgmList, this.oldPgmList)) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this only a problem with the atem source? Maybe it would make sense to do that one level "higher", meaning that TA filters duplicate tally data. Then, we would not have to check for that in each source.
Fixes #469