- Create Economist SubmissionTracking package correctly: * mainArticle = full blog post content * coverLetter = 216-word SIR— letter * Links to blog post via blogPostId - Archive 'Letter to The Economist' from blog posts (it's the cover letter) - Fix date display on article cards (use published_at) - Target publication already displaying via blue badge Database changes: - Make blogPostId optional in SubmissionTracking model - Economist package ID: 68fa85ae49d4900e7f2ecd83 - Le Monde package ID: 68fa2abd2e6acd5691932150 Next: Enhanced modal with tabs, validation, export 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
37 lines
918 B
Python
37 lines
918 B
Python
"""MediaPart and related objects."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import hashlib
|
|
|
|
from pptx.opc.package import Part
|
|
from pptx.util import lazyproperty
|
|
|
|
|
|
class MediaPart(Part):
|
|
"""A media part, containing an audio or video resource.
|
|
|
|
A media part generally has a partname matching the regex
|
|
`ppt/media/media[1-9][0-9]*.*`.
|
|
"""
|
|
|
|
@classmethod
|
|
def new(cls, package, media):
|
|
"""Return new |MediaPart| instance containing `media`.
|
|
|
|
`media` must be a |Media| object.
|
|
"""
|
|
return cls(
|
|
package.next_media_partname(media.ext),
|
|
media.content_type,
|
|
package,
|
|
media.blob,
|
|
)
|
|
|
|
@lazyproperty
|
|
def sha1(self):
|
|
"""The SHA1 hash digest for the media binary of this media part.
|
|
|
|
Example: `'1be010ea47803b00e140b852765cdf84f491da47'`
|
|
"""
|
|
return hashlib.sha1(self._blob).hexdigest()
|