You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.2KB

  1. import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
  2. import Podcast from 'podcast';
  3. import { ItunesEpisodeTypeEnum } from 'schemas/enum/itunes-episode-type.enum';
  4. import { EpisodeEnclosure } from './episode-enclosure';
  5. import { Document } from 'mongoose';
  6. export type EpisodeDocument = Episode & Document;
  7. @Schema()
  8. export class Episode implements Podcast.Item {
  9. @Prop()
  10. title?: string;
  11. @Prop()
  12. description?: string;
  13. @Prop()
  14. url: string;
  15. @Prop()
  16. guid?: string;
  17. @Prop([String])
  18. categories?: string[];
  19. @Prop()
  20. author?: string;
  21. @Prop()
  22. date: Date;
  23. @Prop()
  24. lat?: number;
  25. @Prop()
  26. long?: number;
  27. @Prop(EpisodeEnclosure)
  28. enclosure?: EpisodeEnclosure;
  29. @Prop()
  30. content?: string;
  31. @Prop()
  32. itunesAuthor?: string;
  33. @Prop()
  34. itunesExplicit?: boolean;
  35. @Prop()
  36. itunesSubtitle?: string;
  37. @Prop()
  38. itunesSummary?: string;
  39. @Prop()
  40. itunesDuration?: number;
  41. @Prop()
  42. itunesImage?: string;
  43. @Prop()
  44. itunesSeason?: number;
  45. @Prop()
  46. itunesEpisode?: number;
  47. @Prop()
  48. itunesTitle?: string;
  49. @Prop(ItunesEpisodeTypeEnum)
  50. itunesEpisodeType?: ItunesEpisodeTypeEnum;
  51. }
  52. export const EpisodeSchema = SchemaFactory.createForClass(Episode);