Skip to content

Commit

Permalink
api: stream: test profiles for test creator ids (#2152)
Browse files Browse the repository at this point in the history
* api: stream: test profiles for test creator ids

* todo

* removing old hardcoded debug playback id

* hardcode test profiles

* update

* Make streams from those creators unoverridable

---------

Co-authored-by: Victor Elias <[email protected]>
  • Loading branch information
gioelecerati and victorges authored Apr 29, 2024
1 parent 85bc74b commit 67decac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 1 addition & 4 deletions packages/api/src/controllers/playback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,7 @@ app.get("/:id", async (req, res) => {
let ingest = ingests[0].base;
let { id } = req.params;

if (
(id === "1ba7nrr34rbjl4bb" || req.user?.directPlayback) &&
ingests[0].baseDirect
) {
if (req.user?.directPlayback && ingests[0].baseDirect) {
ingest = ingests[0].baseDirect;
}

Expand Down
10 changes: 10 additions & 0 deletions packages/api/src/controllers/stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,13 @@ const pullStreamKeyAccessors: Record<string, string[]> = {
"pull.source": ["pull", "source"],
};

const testCreatorIds: string[] = [
"73846_104901225_104901225",
"73846_116005487_116003843",
"73846_116003843_116003843",
"73846_115939837_115939837",
];

app.put(
"/pull",
authorizer({}),
Expand Down Expand Up @@ -1139,6 +1146,9 @@ app.put(
pullRegion,
...payload,
};
if (testCreatorIds.includes(stream.creatorId?.value)) {
stream.profiles = oldStream.profiles;
}
await db.stream.replace(stream);
// read from DB again to keep exactly what got saved
stream = await db.stream.get(stream.id, { useReplica: false });
Expand Down

0 comments on commit 67decac

Please sign in to comment.