Skip to content

Commit

Permalink
Merge tag '1.2.11' into develop
Browse files Browse the repository at this point in the history
Fix filename variable
  • Loading branch information
Pof Magicfingers committed Sep 13, 2019
2 parents ef3def0 + 4556281 commit bafd066
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions dist/podcloud-feeds.js
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,6 @@ _mongoose2.default.Promise = global.Promise;
const ObjectId = _mongoose2.default.Schema.Types.ObjectId;

const EnclosureUrlSchema = new _mongoose2.default.Schema({
filename: String,
path: String
});

Expand All @@ -1393,6 +1392,7 @@ const EnclosureSchema = new _mongoose2.default.Schema({
length: String,
mime_type: String,
meta_url: EnclosureUrlSchema,
filename: String,
cover_detected: _cover_schema2.default,
cover_custom: _cover_schema2.default,
cover_choice: String
Expand Down Expand Up @@ -1615,7 +1615,7 @@ const Enclosure = {
return enclosure.mime_type;
},
url(enclosure, args, ctx) {
return "https://" + ctx.hosts.stats + "/" + enclosure.item.feed.identifier + "/" + enclosure.item._slugs[enclosure.item._slugs.length - 1] + "/enclosure." + +(enclosure.item.updated_at / 1000) + _path2.default.extname(enclosure.meta_url.filename).replace(/(.*)\?.*$/, "$1") + "?p=f";
return "https://" + ctx.hosts.stats + "/" + enclosure.item.feed.identifier + "/" + enclosure.item._slugs[enclosure.item._slugs.length - 1] + "/enclosure." + +(enclosure.item.updated_at / 1000) + _path2.default.extname(enclosure.filename).replace(/(.*)\?.*$/, "$1") + "?p=f";
},
cover(enclosure) {
let cover = null;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "podcloud-feeds",
"version": "1.2.10",
"version": "1.2.11",
"description": "GraphQL API for podcloud",
"scripts": {
"test": "NODE_ENV=test mocha --opts test/mocha.opts",
Expand Down
2 changes: 1 addition & 1 deletion src/connectors/item.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Mongoose.Promise = global.Promise
const ObjectId = Mongoose.Schema.Types.ObjectId

const EnclosureUrlSchema = new Mongoose.Schema({
filename: String,
path: String
})

Expand All @@ -15,6 +14,7 @@ const EnclosureSchema = new Mongoose.Schema({
length: String,
mime_type: String,
meta_url: EnclosureUrlSchema,
filename: String,
cover_detected: CoverSchema,
cover_custom: CoverSchema,
cover_choice: String
Expand Down
2 changes: 1 addition & 1 deletion src/schema/types/resolvers/enclosure.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const Enclosure = {
enclosure.item._slugs[enclosure.item._slugs.length - 1] +
"/enclosure." +
+(enclosure.item.updated_at / 1000) +
path.extname(enclosure.meta_url.filename).replace(/(.*)\?.*$/, "$1") +
path.extname(enclosure.filename).replace(/(.*)\?.*$/, "$1") +
"?p=f"
)
},
Expand Down
4 changes: 2 additions & 2 deletions test/src/schema/types/enclosure.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ describe("Enclosure Graph Object", () => {
duration_in_seconds: 600,
length: "123521",
mime_type: "audio/mpeg",
filename: "afile.mp3",
meta_url: {
path: "http://anurl.test/afile.mp3?p=f",
filename: "afile.mp3"
path: "http://anurl.test/afile.mp3?p=f"
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/src/schema/types/episode.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ describe("Episode Graph Object", () => {
duration_in_seconds: 600,
length: "123521",
mime_type: "audio/mpeg",
filename: "filename.mp3",
meta_url: {
path: "http://anurl.test/afile.mp3",
filename: "filename.mp3"
path: "http://anurl.test/afile.mp3"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/src/schema/types/podcastItem.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ describe("PodcastItem Graph Object", () => {
it("should resolve an Episode when an enclosure is available", () => {
const obj = {
enclosure: {
filename: "arealfile.mp3",
meta_url: {
path: "http://anurl.test/afile-123",
filename: "arealfile.mp3"
path: "http://anurl.test/afile-123"
}
}
}
Expand Down

0 comments on commit bafd066

Please sign in to comment.